--- a/Cargo.lock
+++ b/Cargo.lock
@@ -172,29 +172,29 @@ dependencies = [
[[package]]
name = "binjs_meta"
version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"Inflector 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
"itertools 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"webidl 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "binsource"
version = "0.1.0"
dependencies = [
"binjs_meta 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
"clap 2.31.2 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
"itertools 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"webidl 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"yaml-rust 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "bit-set"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -652,17 +652,17 @@ dependencies = [
[[package]]
name = "env_logger"
version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"atty 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"termcolor 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "error-chain"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -781,17 +781,17 @@ dependencies = [
[[package]]
name = "geckodriver"
version = "0.20.1"
dependencies = [
"chrono 0.2.25 (registry+https://github.com/rust-lang/crates.io-index)",
"clap 2.31.2 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.10.13 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"mozprofile 0.3.0",
"mozrunner 0.6.1",
"mozversion 0.1.3",
"regex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
"uuid 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)",
"webdriver 0.35.1",
"zip 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -800,17 +800,17 @@ dependencies = [
[[package]]
name = "geckoservo"
version = "0.0.1"
dependencies = [
"atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.23.9 (registry+https://github.com/rust-lang/crates.io-index)",
"cstr 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"malloc_size_of 0.0.1",
"nsstring 0.1.0",
"parking_lot 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
"selectors 0.19.0",
"servo_arc 0.1.1",
"smallvec 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"style 0.0.1",
"style_traits 0.0.1",
@@ -842,17 +842,17 @@ dependencies = [
"audioipc-server 0.2.3",
"cose-c 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"cubeb-pulse 0.2.0",
"cubeb-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"encoding_c 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"encoding_glue 0.1.0",
"env_logger 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
"geckoservo 0.0.1",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"mozurl 0.0.1",
"mp4parse_capi 0.10.1",
"netwerk_helper 0.0.1",
"nserror 0.1.0",
"nsstring 0.1.0",
"prefs_parser 0.0.1",
"rsdparsa_capi 0.1.0",
"u2fhid 0.2.0",
@@ -861,17 +861,17 @@ dependencies = [
]
[[package]]
name = "gl_generator"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"khronos_api 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"xml-rs 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "gleam"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
@@ -976,17 +976,17 @@ name = "js"
version = "0.1.4"
dependencies = [
"bindgen 0.33.2 (registry+https://github.com/rust-lang/crates.io-index)",
"cmake 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
"glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"mozjs_sys 0.0.0",
"num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "kernel32-sys"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1117,22 +1117,22 @@ name = "linked-hash-map"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "log"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "log"
-version = "0.4.1"
+version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "malloc_size_of"
version = "0.0.1"
@@ -1278,17 +1278,17 @@ version = "0.3.0"
dependencies = [
"tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "mozrunner"
version = "0.6.1"
dependencies = [
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"mozprofile 0.3.0",
"winreg 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "mozurl"
version = "0.0.1"
dependencies = [
@@ -1308,31 +1308,31 @@ dependencies = [
]
[[package]]
name = "mp4parse"
version = "0.10.1"
dependencies = [
"bitreader 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"mp4parse_fallible 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "mp4parse-gtest"
version = "0.1.0"
[[package]]
name = "mp4parse_capi"
version = "0.10.1"
dependencies = [
"byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"mp4parse 0.10.1",
"num-traits 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "mp4parse_fallible"
version = "0.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1565,17 +1565,17 @@ source = "registry+https://github.com/ru
[[package]]
name = "plane-split"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"binary-space-partition 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "podio"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1749,17 +1749,17 @@ name = "runloop"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "rust-ini"
version = "0.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rustc-serialize"
version = "0.3.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
@@ -1787,17 +1787,17 @@ source = "registry+https://github.com/ru
[[package]]
name = "selectors"
version = "0.19.0"
dependencies = [
"bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.23.9 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"phf 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)",
"phf_codegen 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)",
"precomputed-hash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"servo_arc 0.1.1",
"smallvec 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -1937,17 +1937,17 @@ dependencies = [
"euclid 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)",
"fallible 0.0.1",
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
"hashglobe 0.1.0",
"itertools 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)",
"itoa 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"malloc_size_of 0.0.1",
"malloc_size_of_derive 0.0.1",
"matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"new-ordered-float 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"new_debug_unreachable 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"nsstring 0.1.0",
"num-integer 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2002,17 +2002,17 @@ version = "0.0.1"
dependencies = [
"atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.23.9 (registry+https://github.com/rust-lang/crates.io-index)",
"cstr 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)",
"geckoservo 0.0.1",
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"malloc_size_of 0.0.1",
"regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"selectors 0.19.0",
"size_of_test 0.0.1",
"smallvec 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"style 0.0.1",
"style_traits 0.0.1",
]
@@ -2182,17 +2182,17 @@ version = "0.2.0"
dependencies = [
"bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"boxfnonce 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"core-foundation 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-foundation-sys 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"devd-rs 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
"libudev 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)",
"runloop 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "ucd-util"
version = "0.1.1"
@@ -2304,17 +2304,17 @@ dependencies = [
]
[[package]]
name = "webdriver"
version = "0.35.1"
dependencies = [
"cookie 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.10.13 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-segmentation 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -2339,17 +2339,17 @@ dependencies = [
"core-graphics 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-text 9.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"dwrote 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)",
"freetype 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
"plane-split 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rayon 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ron 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.58 (registry+https://github.com/rust-lang/crates.io-index)",
"smallvec 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"thread_profiler 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2382,17 +2382,17 @@ dependencies = [
"bincode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"core-graphics 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)",
"dwrote 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.17.3 (registry+https://github.com/rust-lang/crates.io-index)",
"foreign-types 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"nsstring 0.1.0",
"rayon 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"thread_profiler 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"uuid 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)",
"webrender 0.57.2",
]
[[package]]
@@ -2620,17 +2620,17 @@ dependencies = [
"checksum lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e6412c5e2ad9584b0b8e979393122026cdd6d2a80b933f890dcd694ddbe73739"
"checksum lazycell 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ce12306c4739d86ee97c23139f3a34ddf0387bbf181bc7929d287025a8c3ef6b"
"checksum libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)" = "f54263ad99207254cf58b5f701ecb432c717445ea2ee8af387334bdd1a03fdff"
"checksum libloading 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9c3ad660d7cb8c5822cd83d10897b0f1f1526792737a179e73896152f85b88c2"
"checksum libudev 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ea626d3bdf40a1c5aee3bcd4f40826970cae8d80a8fec934c82a63840094dcfe"
"checksum libz-sys 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)" = "3fdd64ef8ee652185674455c1d450b83cbc8ad895625d543b5324d923f82e4d8"
"checksum linked-hash-map 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "70fb39025bc7cdd76305867c4eccf2f2dcf6e9a57f5b21a93e1c2d86cd03ec9e"
"checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b"
-"checksum log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "89f010e843f2b1a31dbd316b3b8d443758bc634bed37aabade59c686d644e0a2"
+"checksum log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6fddaa003a65722a7fb9e26b0ce95921fe4ba590542ced664d8ce2fa26f9f3ac"
"checksum matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "100aabe6b8ff4e4a7e32c1c13523379802df0772b82466207ac25b013f193376"
"checksum memchr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "148fab2e51b4f1cfc66da2a7c32981d1d3c083a803978268bb11fe4b86925e7a"
"checksum memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "796fba70e76612589ed2ce7f45282f5af869e0fdd7cc6199fa1aa1f1d591ba9d"
"checksum memmap 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "46f3c7359028b31999287dae4e5047ddfe90a23b7dca2282ce759b491080c99b"
"checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3"
"checksum mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0"
"checksum miniz_oxide 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "aaa2d3ad070f428fffbd7d3ca2ea20bb0d8cffe9024405c44e1840bc1418b398"
"checksum miniz_oxide_c_api 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "92d98fdbd6145645828069b37ea92ca3de225e000d80702da25c20d3584b38a5"
--- a/third_party/rust/log/.cargo-checksum.json
+++ b/third_party/rust/log/.cargo-checksum.json
@@ -1,1 +1,1 @@
-{"files":{".travis.yml":"8e95f3543ff36e1fd0e2e2fcc98b31e20dcc19d220f3d7d19bfb9aeb61030823","CHANGELOG.md":"cdfe104547fca9d80b95cff2c6ef5af7cdcd0a17886ec3722c157a598abec018","Cargo.toml":"ba13b382a64b910241ce4fc2ac4f45dd3a8f404f762f07958004a41de1cb55df","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"95873097578066ef6a0cc395f1aad5596762570ba1476757643fb319e3892481","appveyor.yml":"d5376a881aef6dc3bed6a6b51f1f1c3801b88fc77a12895f6953190256e965bc","src/lib.rs":"4ffa677655636a6c111026d318c92bb53bd91988e601fcdcdbe1f43b1997b8fd","src/macros.rs":"064c96e154b58b61b8a4f11cab9c0664dd171010f578af438fad0dc1d796ac5c","src/serde.rs":"7617ffa21dde363a06389f8e26661f35550c1a01ff142f81275e95f42b79c854","tests/filters.rs":"6aee024d4594b4fde772e35c5d3318e5aa5d9aa4eaeafb04e4c7c922be4ac837"},"package":"89f010e843f2b1a31dbd316b3b8d443758bc634bed37aabade59c686d644e0a2"}
\ No newline at end of file
+{"files":{".travis.yml":"8e95f3543ff36e1fd0e2e2fcc98b31e20dcc19d220f3d7d19bfb9aeb61030823","CHANGELOG.md":"be517021ee88b47fcf34646e3f1797d04716f6ec89456aefad91f5827fdf46de","Cargo.toml":"f024400f35949bfb0c40fde1aad0ec92110fbac3232a5440d619413b29d4af08","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"6485b8ed310d3f0340bf1ad1f47645069ce4069dcc6bb46c7d5c6faf41de1fdb","README.md":"07f2741a5bb74a952fe8fac006285649a65d737c358504e9337a158d84d2b38f","appveyor.yml":"d5376a881aef6dc3bed6a6b51f1f1c3801b88fc77a12895f6953190256e965bc","src/lib.rs":"ef06fbd35cd13ba193cb8d5cc1999a24b30c1ead90a30a969cccc00989eb8bb9","src/macros.rs":"80191f9d62ea3e04738ce5353851d1b26b9b190342191f678745eccf3ff7e6fe","src/serde.rs":"a5ae50d6f5ac538a5ca57ee58031a2582afa6989c741574584756632a4131ba7","tests/filters.rs":"6aee024d4594b4fde772e35c5d3318e5aa5d9aa4eaeafb04e4c7c922be4ac837"},"package":"6fddaa003a65722a7fb9e26b0ce95921fe4ba590542ced664d8ce2fa26f9f3ac"}
\ No newline at end of file
--- a/third_party/rust/log/CHANGELOG.md
+++ b/third_party/rust/log/CHANGELOG.md
@@ -1,12 +1,22 @@
# Change Log
## [Unreleased]
+## [0.4.2] - 2018-06-05
+
+### Improved
+
+* Log invocations now generate less code.
+
+### Fixed
+
+* Example Logger implementations now properly set the max log level.
+
## [0.4.1] - 2017-12-30
### Fixed
* Some doc links were fixed.
## [0.4.0] - 2017-12-24
@@ -72,12 +82,13 @@ version using log 0.4.x to avoid losing
* We're looking to add support for *structured* logging - the inclusion of extra key-value pairs of
information in a log event in addition to the normal string message. This should be able to be
added in a backwards compatible manner to the 0.4.x series when the design is worked out.
## Older
Look at the [release tags] for information about older releases.
-[Unreleased]: https://github.com/rust-lang-nursery/log/compare/0.4.1...HEAD
+[Unreleased]: https://github.com/rust-lang-nursery/log/compare/0.4.2...HEAD
+[0.4.2]: https://github.com/rust-lang-nursery/log/compare/0.4.1...0.4.2
[0.4.1]: https://github.com/rust-lang-nursery/log/compare/0.4.0...0.4.1
[0.4.0]: https://github.com/rust-lang-nursery/log/compare/0.3.8...0.4.0
[release tags]: https://github.com/rust-lang-nursery/log/releases
--- a/third_party/rust/log/Cargo.toml
+++ b/third_party/rust/log/Cargo.toml
@@ -7,17 +7,17 @@
#
# If you believe there's an error in this file please file an
# issue against the rust-lang/cargo repository. If you're
# editing this file be aware that the upstream Cargo.toml
# will likely look very different (and much more reasonable)
[package]
name = "log"
-version = "0.4.1"
+version = "0.4.2"
authors = ["The Rust Project Developers"]
description = "A lightweight logging facade for Rust\n"
homepage = "https://github.com/rust-lang/log"
documentation = "https://docs.rs/log"
readme = "README.md"
keywords = ["logging"]
categories = ["development-tools::debugging"]
license = "MIT/Apache-2.0"
--- a/third_party/rust/log/README.md
+++ b/third_party/rust/log/README.md
@@ -24,17 +24,17 @@ log whatever information will be useful
[dependencies]
log = "0.4"
```
```rust
#[macro_use]
extern crate log;
-pub fn shave_the_yak(yak: &Yak) {
+pub fn shave_the_yak(yak: &mut Yak) {
trace!("Commencing yak shaving");
loop {
match find_a_razor() {
Ok(razor) => {
info!("Razor located: {}", razor);
yak.shave(razor);
break;
@@ -60,15 +60,16 @@ There are many available implementations
* [`stderrlog`](https://docs.rs/stderrlog/*/stderrlog/)
* [`flexi_logger`](https://docs.rs/flexi_logger/*/flexi_logger/)
* Complex configurable frameworks:
* [`log4rs`](https://docs.rs/log4rs/*/log4rs/)
* [`fern`](https://docs.rs/fern/*/fern/)
* Adaptors for other facilities:
* [`syslog`](https://docs.rs/syslog/*/syslog/)
* [`slog-stdlog`](https://docs.rs/slog-stdlog/*/slog_stdlog/)
+ * [`android_log`](https://docs.rs/android_log/*/android_log/)
Executables should choose a logger implementation and initialize it early in the
runtime of the program. Logger implementations will typically include a
function to do this. Any log messages generated before the logger is
initialized will be ignored.
The executable itself may use the `log` crate to log as well.
--- a/third_party/rust/log/src/lib.rs
+++ b/third_party/rust/log/src/lib.rs
@@ -48,19 +48,19 @@
//! ### Examples
//!
//! ```rust
//! # #![allow(unstable)]
//! #[macro_use]
//! extern crate log;
//!
//! # #[derive(Debug)] pub struct Yak(String);
-//! # impl Yak { fn shave(&self, _: u32) {} }
+//! # impl Yak { fn shave(&mut self, _: u32) {} }
//! # fn find_a_razor() -> Result<u32, u32> { Ok(1) }
-//! pub fn shave_the_yak(yak: &Yak) {
+//! pub fn shave_the_yak(yak: &mut Yak) {
//! info!(target: "yak_events", "Commencing yak shaving for {:?}", yak);
//!
//! loop {
//! match find_a_razor() {
//! Ok(razor) => {
//! info!("Razor located: {}", razor);
//! yak.shave(razor);
//! break;
@@ -133,26 +133,26 @@
//! }
//!
//! fn flush(&self) {}
//! }
//!
//! # fn main() {}
//! ```
//!
-//! Loggers are installed by calling the [`set_logger`] function. It takes a
-//! closure which is provided a [`MaxLevelFilter`] token and returns a
-//! [`Log`] trait object. The [`MaxLevelFilter`] token controls the global
-//! maximum log level. The logging facade uses this as an optimization to
-//! improve performance of log messages at levels that are disabled. In the
-//! case of our example logger, we'll want to set the maximum log level to
-//! [`Info`][level_link], since we ignore any [`Debug`][level_link] or
-//! [`Trace`][level_link] level log messages. A logging implementation
-//! should provide a function that wraps a call to [`set_logger`], handling
-//! initialization of the logger:
+//! Loggers are installed by calling the [`set_logger`] function. The maximum
+//! log level also needs to be adjusted via the [`set_max_level`] function. The
+//! logging facade uses this as an optimization to improve performance of log
+//! messages at levels that are disabled. It's important to set it, as it
+//! defaults to [`Off`][filter_link], so no log messages will ever be captured!
+//! In the case of our example logger, we'll want to set the maximum log level
+//! to [`Info`][filter_link], since we ignore any [`Debug`][level_link] or
+//! [`Trace`][level_link] level log messages. A logging implementation should
+//! provide a function that wraps a call to [`set_logger`] and
+//! [`set_max_level`], handling initialization of the logger:
//!
//! ```rust
//! # extern crate log;
//! # use log::{Level, Metadata};
//! # struct SimpleLogger;
//! # impl log::Log for SimpleLogger {
//! # fn enabled(&self, _: &Metadata) -> bool { false }
//! # fn log(&self, _: &log::Record) {}
@@ -160,40 +160,45 @@
//! # }
//! # fn main() {}
//! use log::{SetLoggerError, LevelFilter};
//!
//! static LOGGER: SimpleLogger = SimpleLogger;
//!
//! pub fn init() -> Result<(), SetLoggerError> {
//! log::set_logger(&LOGGER)
+//! .map(|()| log::set_max_level(LevelFilter::Info))
//! }
//! ```
//!
+//! Implementations that adjust their configurations at runtime should take care
+//! to adjust the maximum log level as well.
+//!
//! # Use with `std`
//!
-//! `set_logger` requires you to provide a `&'static Log`, which can be hard if
-//! your logger depends on some runtime configuration. The `set_boxed_logger`
-//! function is available with the `std` Cargo feature. It is identical to
-//! `set_logger` except that it requires you to provide a `Box<Log>` rather than
-//! a `&'static Log`:
+//! `set_logger` requires you to provide a `&'static Log`, which can be hard to
+//! obtain if your logger depends on some runtime configuration. The
+//! `set_boxed_logger` function is available with the `std` Cargo feature. It is
+//! identical to `set_logger` except that it takes a `Box<Log>` rather than a
+//! `&'static Log`:
//!
//! ```rust
//! # extern crate log;
//! # use log::{Level, LevelFilter, Log, SetLoggerError, Metadata};
//! # struct SimpleLogger;
//! # impl log::Log for SimpleLogger {
//! # fn enabled(&self, _: &Metadata) -> bool { false }
//! # fn log(&self, _: &log::Record) {}
//! # fn flush(&self) {}
//! # }
//! # fn main() {}
//! # #[cfg(feature = "std")]
//! pub fn init() -> Result<(), SetLoggerError> {
//! log::set_boxed_logger(Box::new(SimpleLogger))
+//! .map(|()| log::set_max_level(LevelFilter::Info))
//! }
//! ```
//!
//! # Compile time filters
//!
//! Log levels can be statically disabled at compile time via Cargo features. Log invocations at
//! disabled levels will be skipped and will not even be present in the resulting binary unless the
//! log level is specified dynamically. This level is configured separately for release and debug
@@ -217,49 +222,63 @@
//!
//! For example, a crate can disable trace level logs in debug builds and trace, info, and warn
//! level logs in release builds with the following configuration:
//!
//! ```toml
//! [dependencies]
//! log = { version = "0.4", features = ["max_level_debug", "release_max_level_warn"] }
//! ```
+//! # Crate Feature Flags
+//!
+//! The following crate feature flags are avaliable in addition to the filters. They are
+//! configured in your `Cargo.toml`.
+//!
+//! * `std` allows use of `std` crate instead of the default `core`. Enables using `std::error` and
+//! `set_boxed_logger` functionality.
+//! * `serde` enables support for serialization and deserialization of `Level` and `LevelFilter`.
+//!
+//! ```toml
+//! [dependencies]
+//! log = { version = "0.4", features = ["std", "serde"] }
+//! ```
//!
//! # Version compatibility
//!
//! The 0.3 and 0.4 versions of the `log` crate are almost entirely compatible. Log messages
//! made using `log` 0.3 will forward transparently to a logger implementation using `log` 0.4. Log
//! messages made using `log` 0.4 will forward to a logger implementation using `log` 0.3, but the
//! module path and file name information associated with the message will unfortunately be lost.
//!
//! [`Log`]: trait.Log.html
//! [level_link]: enum.Level.html
+//! [filter_link]: enum.LevelFilter.html
//! [`set_logger`]: fn.set_logger.html
-//! [`MaxLevelFilter`]: struct.MaxLevelFilter.html
+//! [`set_max_level`]: fn.set_max_level.html
//! [`try_set_logger_raw`]: fn.try_set_logger_raw.html
//! [`shutdown_logger_raw`]: fn.shutdown_logger_raw.html
//! [env_logger]: https://docs.rs/env_logger/*/env_logger/
//! [simple_logger]: https://github.com/borntyping/rust-simple_logger
//! [simplelog]: https://github.com/drakulix/simplelog.rs
//! [pretty_env_logger]: https://docs.rs/pretty_env_logger/*/pretty_env_logger/
//! [stderrlog]: https://docs.rs/stderrlog/*/stderrlog/
//! [flexi_logger]: https://docs.rs/flexi_logger/*/flexi_logger/
//! [syslog]: https://docs.rs/syslog/*/syslog/
//! [slog-stdlog]: https://docs.rs/slog-stdlog/*/slog_stdlog/
//! [log4rs]: https://docs.rs/log4rs/*/log4rs/
//! [fern]: https://docs.rs/fern/*/fern/
-#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
- html_favicon_url = "https://www.rust-lang.org/favicon.ico",
- html_root_url = "https://docs.rs/log/0.4.1")]
+#![doc(
+ html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
+ html_favicon_url = "https://www.rust-lang.org/favicon.ico",
+ html_root_url = "https://docs.rs/log/0.4"
+)]
#![warn(missing_docs)]
#![deny(missing_debug_implementations)]
-
#![cfg_attr(not(feature = "std"), no_std)]
-
// When compiled for the rustc compiler itself we want to make sure that this is
// an unstable crate
#![cfg_attr(rustbuild, feature(staged_api, rustc_private))]
#![cfg_attr(rustbuild, unstable(feature = "rustc_private", issue = "27812"))]
#[cfg(not(feature = "std"))]
extern crate core as std;
@@ -267,17 +286,17 @@ extern crate core as std;
extern crate cfg_if;
use std::cmp;
#[cfg(feature = "std")]
use std::error;
use std::fmt;
use std::mem;
use std::str::FromStr;
-use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering};
+use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT};
#[macro_use]
mod macros;
mod serde;
// The LOGGER static holds a pointer to the global logger. It is protected by
// the STATE static which determines whether LOGGER has been initialized yet.
static mut LOGGER: &'static Log = &NopLogger;
@@ -289,20 +308,20 @@ static STATE: AtomicUsize = ATOMIC_USIZE
const UNINITIALIZED: usize = 0;
const INITIALIZING: usize = 1;
const INITIALIZED: usize = 2;
static MAX_LOG_LEVEL_FILTER: AtomicUsize = ATOMIC_USIZE_INIT;
static LOG_LEVEL_NAMES: [&'static str; 6] = ["OFF", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"];
-static SET_LOGGER_ERROR: &'static str = "attempted to set a logger after the logging system was \
- already initialized";
-static LEVEL_PARSE_ERROR: &'static str = "attempted to convert a string that doesn't match an \
- existing log level";
+static SET_LOGGER_ERROR: &'static str = "attempted to set a logger after the logging system \
+ was already initialized";
+static LEVEL_PARSE_ERROR: &'static str =
+ "attempted to convert a string that doesn't match an existing log level";
/// An enum representing the available verbosity levels of the logger.
///
/// Typical usage includes: checking if a certain `Level` is enabled with
/// [`log_enabled!`](macro.log_enabled.html), specifying the `Level` of
/// [`log!`](macro.log.html), and comparing a `Level` directly to a
/// [`LevelFilter`](enum.LevelFilter.html).
#[repr(usize)]
@@ -385,19 +404,19 @@ fn eq_ignore_ascii_case(a: &str, b: &str
if c >= b'a' && c <= b'z' {
c - b'a' + b'A'
} else {
c
}
}
if a.len() == b.len() {
- a.bytes().zip(b.bytes()).all(|(a, b)| {
- to_ascii_uppercase(a) == to_ascii_uppercase(b)
- })
+ a.bytes()
+ .zip(b.bytes())
+ .all(|(a, b)| to_ascii_uppercase(a) == to_ascii_uppercase(b))
} else {
false
}
}
impl FromStr for Level {
type Err = ParseLevelError;
fn from_str(level: &str) -> Result<Level, Self::Err> {
@@ -1043,17 +1062,17 @@ pub fn set_boxed_logger(logger: Box<Log>
/// # }
/// ```
pub fn set_logger(logger: &'static Log) -> Result<(), SetLoggerError> {
set_logger_inner(|| logger)
}
fn set_logger_inner<F>(make_logger: F) -> Result<(), SetLoggerError>
where
- F: FnOnce() -> &'static Log
+ F: FnOnce() -> &'static Log,
{
unsafe {
if STATE.compare_and_swap(UNINITIALIZED, INITIALIZING, Ordering::SeqCst) != UNINITIALIZED {
return Err(SetLoggerError(()));
}
LOGGER = make_logger();
STATE.store(INITIALIZED, Ordering::SeqCst);
@@ -1112,16 +1131,44 @@ pub fn logger() -> &'static Log {
static NOP: NopLogger = NopLogger;
&NOP
} else {
LOGGER
}
}
}
+// WARNING: this is not part of the crate's public API and is subject to change at any time
+#[doc(hidden)]
+pub fn __private_api_log(
+ args: fmt::Arguments,
+ level: Level,
+ target: &str,
+ module_path: &str,
+ file: &str,
+ line: u32,
+) {
+ logger().log(
+ &Record::builder()
+ .args(args)
+ .level(level)
+ .target(target)
+ .module_path(Some(module_path))
+ .file(Some(file))
+ .line(Some(line))
+ .build(),
+ );
+}
+
+// WARNING: this is not part of the crate's public API and is subject to change at any time
+#[doc(hidden)]
+pub fn __private_api_enabled(level: Level, target: &str) -> bool {
+ logger().enabled(&Metadata::builder().level(level).target(target).build())
+}
+
/// The statically resolved maximum log level.
///
/// See the crate level documentation for information on how to configure this.
///
/// This value is checked by the log macros, but not by the `Log`ger returned by
/// the [`logger`] function. Code that manually calls functions on that value
/// should compare the level against this value.
///
@@ -1154,18 +1201,18 @@ cfg_if! {
} else {
const MAX_LEVEL_INNER: LevelFilter = LevelFilter::Trace;
}
}
#[cfg(test)]
mod tests {
extern crate std;
+ use super::{Level, LevelFilter, ParseLevelError};
use tests::std::string::ToString;
- use super::{Level, LevelFilter, ParseLevelError};
#[test]
fn test_levelfilter_from_str() {
let tests = [
("off", Ok(LevelFilter::Off)),
("error", Ok(LevelFilter::Error)),
("warn", Ok(LevelFilter::Warn)),
("info", Ok(LevelFilter::Info)),
@@ -1242,23 +1289,23 @@ mod tests {
fn test_to_level_filter() {
assert_eq!(LevelFilter::Error, Level::Error.to_level_filter());
assert_eq!(LevelFilter::Trace, Level::Trace.to_level_filter());
}
#[test]
#[cfg(feature = "std")]
fn test_error_trait() {
+ use super::SetLoggerError;
use std::error::Error;
- use super::SetLoggerError;
let e = SetLoggerError(());
assert_eq!(
e.description(),
"attempted to set a logger after the logging system \
- was already initialized"
+ was already initialized"
);
}
#[test]
fn test_metadata_builder() {
use super::MetadataBuilder;
let target = "myApp";
let metadata_test = MetadataBuilder::new()
@@ -1316,17 +1363,17 @@ mod tests {
assert_eq!(record_test.target(), "myApp");
assert_eq!(record_test.module_path(), Some("foo"));
assert_eq!(record_test.file(), Some("bar"));
assert_eq!(record_test.line(), Some(30));
}
#[test]
fn test_record_complete_builder() {
- use super::{Record, Level};
+ use super::{Level, Record};
let target = "myApp";
let record_test = Record::builder()
.module_path(Some("foo"))
.file(Some("bar"))
.line(Some(30))
.target(target)
.level(Level::Error)
.build();
--- a/third_party/rust/log/src/macros.rs
+++ b/third_party/rust/log/src/macros.rs
@@ -29,27 +29,24 @@
/// data.0, data.1, private_data);
/// # }
/// ```
#[macro_export]
macro_rules! log {
(target: $target:expr, $lvl:expr, $($arg:tt)+) => ({
let lvl = $lvl;
if lvl <= $crate::STATIC_MAX_LEVEL && lvl <= $crate::max_level() {
- $crate::Log::log(
- $crate::logger(),
- &$crate::RecordBuilder::new()
- .args(format_args!($($arg)+))
- .level(lvl)
- .target($target)
- .module_path(Some(module_path!()))
- .file(Some(file!()))
- .line(Some(line!()))
- .build()
- )
+ $crate::__private_api_log(
+ format_args!($($arg)+),
+ lvl,
+ $target,
+ module_path!(),
+ file!(),
+ line!(),
+ );
}
});
($lvl:expr, $($arg:tt)+) => (log!(target: module_path!(), $lvl, $($arg)+))
}
/// Logs a message at the error level.
///
/// # Examples
@@ -200,21 +197,18 @@ macro_rules! trace {
/// }
/// # }
/// # struct Data { x: u32, y: u32 }
/// # fn expensive_call() -> Data { Data { x: 0, y: 0 } }
/// # fn main() {}
/// ```
#[macro_export]
macro_rules! log_enabled {
- (target: $target:expr, $lvl:expr) => ({
+ (target: $target:expr, $lvl:expr) => {{
let lvl = $lvl;
- lvl <= $crate::STATIC_MAX_LEVEL && lvl <= $crate::max_level() &&
- $crate::Log::enabled(
- $crate::logger(),
- &$crate::MetadataBuilder::new()
- .level(lvl)
- .target($target)
- .build(),
- )
- });
- ($lvl:expr) => (log_enabled!(target: module_path!(), $lvl))
+ lvl <= $crate::STATIC_MAX_LEVEL
+ && lvl <= $crate::max_level()
+ && $crate::__private_api_enabled(lvl, $target)
+ }};
+ ($lvl:expr) => {
+ log_enabled!(target: module_path!(), $lvl)
+ };
}
--- a/third_party/rust/log/src/serde.rs
+++ b/third_party/rust/log/src/serde.rs
@@ -1,19 +1,19 @@
#![cfg(feature = "serde")]
extern crate serde;
use self::serde::ser::{Serialize, Serializer};
use self::serde::de::{Deserialize, DeserializeSeed, Deserializer, Visitor, EnumAccess,
- VariantAccess, Error};
+ Unexpected, VariantAccess, Error};
use {Level, LevelFilter, LOG_LEVEL_NAMES};
use std::fmt;
-use std::str::FromStr;
+use std::str::{self, FromStr};
// The Deserialize impls are handwritten to be case insensitive using FromStr.
impl Serialize for Level {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{
@@ -43,16 +43,26 @@ impl<'de> Deserialize<'de> for Level {
fn visit_str<E>(self, s: &str) -> Result<Self::Value, E>
where
E: Error,
{
// Case insensitive.
FromStr::from_str(s).map_err(|_| Error::unknown_variant(s, &LOG_LEVEL_NAMES[1..]))
}
+
+ fn visit_bytes<E>(self, value: &[u8]) -> Result<Self::Value, E>
+ where
+ E: Error,
+ {
+ let variant = str::from_utf8(value)
+ .map_err(|_| Error::invalid_value(Unexpected::Bytes(value), &self))?;
+
+ self.visit_str(variant)
+ }
}
impl<'de> DeserializeSeed<'de> for LevelIdentifier {
type Value = Level;
fn deserialize<D>(self, deserializer: D) -> Result<Self::Value, D::Error>
where
D: Deserializer<'de>,
@@ -117,16 +127,26 @@ impl<'de> Deserialize<'de> for LevelFilt
fn visit_str<E>(self, s: &str) -> Result<Self::Value, E>
where
E: Error,
{
// Case insensitive.
FromStr::from_str(s).map_err(|_| Error::unknown_variant(s, &LOG_LEVEL_NAMES))
}
+
+ fn visit_bytes<E>(self, value: &[u8]) -> Result<Self::Value, E>
+ where
+ E: Error,
+ {
+ let variant = str::from_utf8(value)
+ .map_err(|_| Error::invalid_value(Unexpected::Bytes(value), &self))?;
+
+ self.visit_str(variant)
+ }
}
impl<'de> DeserializeSeed<'de> for LevelFilterIdentifier {
type Value = LevelFilter;
fn deserialize<D>(self, deserializer: D) -> Result<Self::Value, D::Error>
where
D: Deserializer<'de>,
@@ -157,34 +177,52 @@ impl<'de> Deserialize<'de> for LevelFilt
deserializer.deserialize_enum("LevelFilter", &LOG_LEVEL_NAMES, LevelFilterEnum)
}
}
#[cfg(test)]
mod tests {
extern crate serde_test;
- use self::serde_test::{Token, assert_tokens, assert_de_tokens, assert_de_tokens_error};
+ use self::serde_test::{assert_de_tokens, assert_de_tokens_error, assert_tokens, Token};
use {Level, LevelFilter};
fn level_token(variant: &'static str) -> Token {
Token::UnitVariant {
name: "Level",
variant: variant,
}
}
+ fn level_bytes_tokens(variant: &'static [u8]) -> [Token; 3] {
+ [
+ Token::Enum { name: "Level" },
+ Token::Bytes(variant),
+ Token::Unit,
+ ]
+ }
+
fn level_filter_token(variant: &'static str) -> Token {
Token::UnitVariant {
name: "LevelFilter",
variant: variant,
}
}
+ fn level_filter_bytes_tokens(variant: &'static [u8]) -> [Token; 3] {
+ [
+ Token::Enum {
+ name: "LevelFilter",
+ },
+ Token::Bytes(variant),
+ Token::Unit,
+ ]
+ }
+
#[test]
fn test_level_ser_de() {
let cases = [
(Level::Error, [level_token("ERROR")]),
(Level::Warn, [level_token("WARN")]),
(Level::Info, [level_token("INFO")]),
(Level::Debug, [level_token("DEBUG")]),
(Level::Trace, [level_token("TRACE")]),
@@ -206,16 +244,31 @@ mod tests {
];
for &(s, expected) in &cases {
assert_de_tokens(&s, &expected);
}
}
#[test]
+ fn test_level_de_bytes() {
+ let cases = [
+ (Level::Error, level_bytes_tokens(b"ERROR")),
+ (Level::Warn, level_bytes_tokens(b"WARN")),
+ (Level::Info, level_bytes_tokens(b"INFO")),
+ (Level::Debug, level_bytes_tokens(b"DEBUG")),
+ (Level::Trace, level_bytes_tokens(b"TRACE")),
+ ];
+
+ for &(value, tokens) in &cases {
+ assert_de_tokens(&value, &tokens);
+ }
+ }
+
+ #[test]
fn test_level_de_error() {
let msg = "unknown variant `errorx`, expected one of \
`ERROR`, `WARN`, `INFO`, `DEBUG`, `TRACE`";
assert_de_tokens_error::<Level>(&[level_token("errorx")], msg);
}
#[test]
fn test_level_filter_ser_de() {
@@ -245,14 +298,30 @@ mod tests {
];
for &(s, expected) in &cases {
assert_de_tokens(&s, &expected);
}
}
#[test]
+ fn test_level_filter_de_bytes() {
+ let cases = [
+ (LevelFilter::Off, level_filter_bytes_tokens(b"OFF")),
+ (LevelFilter::Error, level_filter_bytes_tokens(b"ERROR")),
+ (LevelFilter::Warn, level_filter_bytes_tokens(b"WARN")),
+ (LevelFilter::Info, level_filter_bytes_tokens(b"INFO")),
+ (LevelFilter::Debug, level_filter_bytes_tokens(b"DEBUG")),
+ (LevelFilter::Trace, level_filter_bytes_tokens(b"TRACE")),
+ ];
+
+ for &(value, tokens) in &cases {
+ assert_de_tokens(&value, &tokens);
+ }
+ }
+
+ #[test]
fn test_level_filter_de_error() {
let msg = "unknown variant `errorx`, expected one of \
`OFF`, `ERROR`, `WARN`, `INFO`, `DEBUG`, `TRACE`";
assert_de_tokens_error::<LevelFilter>(&[level_filter_token("errorx")], msg);
}
}