diff options
author | Sascha Grunert <mail@saschagrunert.de> | 2017-02-13 13:47:26 +0100 |
---|---|---|
committer | Sascha Grunert <mail@saschagrunert.de> | 2017-02-13 14:15:26 +0100 |
commit | 3de32f4b48bc48c9f47cfe43196d88fd67152650 (patch) | |
tree | 3acb1a039a690f10c028e7d597c01cec9311937d | |
parent | aa6c59a8a4028169ac9feceaa68466ac91eec7f0 (diff) |
Fixed build to toml 0.3.0
-rw-r--r-- | .gitjournal.toml | 2 | ||||
-rw-r--r-- | Cargo.lock | 255 | ||||
-rw-r--r-- | Cargo.toml | 6 | ||||
-rw-r--r-- | benches/bench.rs | 8 | ||||
-rw-r--r-- | src/config.rs | 25 | ||||
-rw-r--r-- | src/lib.rs | 41 | ||||
-rw-r--r-- | src/parser.rs | 81 |
7 files changed, 261 insertions, 157 deletions
diff --git a/.gitjournal.toml b/.gitjournal.toml index 508a97e..82f8d7d 100644 --- a/.gitjournal.toml +++ b/.gitjournal.toml @@ -2,8 +2,8 @@ categories = ["Added", "Changed", "Fixed", "Improved", "Removed"] category_delimiters = ["[", "]"] colored_output = true enable_debug = true -enable_footers = false excluded_commit_tags = [] +enable_footers = false show_commit_hash = false show_prefix = false sort_by = "date" @@ -1,19 +1,20 @@ [root] name = "git-journal" -version = "1.3.1" +version = "1.4.0" dependencies = [ - "chrono 0.2.25 (registry+https://github.com/rust-lang/crates.io-index)", - "clap 2.19.3 (registry+https://github.com/rust-lang/crates.io-index)", - "git2 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "clap 2.20.3 (registry+https://github.com/rust-lang/crates.io-index)", + "git2 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "mowl 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "nom 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "mowl 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "nom 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", - "term 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "toml 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)", + "term 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", + "toml 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -25,6 +26,14 @@ dependencies = [ ] [[package]] +name = "aho-corasick" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] name = "ansi_term" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -36,7 +45,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "chrono" -version = "0.2.25" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "num 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", @@ -45,15 +54,15 @@ dependencies = [ [[package]] name = "clap" -version = "2.19.3" +version = "2.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", - "strsim 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "term_size 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-segmentation 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "term_size 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-segmentation 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "vec_map 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "yaml-rust 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -64,18 +73,18 @@ name = "cmake" version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gcc 0.3.41 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.43 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "curl-sys" -version = "0.3.6" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gcc 0.3.41 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.43 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", "libz-sys 1.0.12 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -89,13 +98,8 @@ dependencies = [ ] [[package]] -name = "error-chain" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] name = "gcc" -version = "0.3.41" +version = "0.3.43" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -109,15 +113,15 @@ dependencies = [ [[package]] name = "git2" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", "libgit2-sys 0.6.6 (registry+https://github.com/rust-lang/crates.io-index)", "openssl-probe 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -126,8 +130,8 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-bidi 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-normalization 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-bidi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-normalization 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -155,12 +159,12 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cmake 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", - "curl-sys 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "gcc 0.3.41 (registry+https://github.com/rust-lang/crates.io-index)", + "curl-sys 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.43 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", "libssh2-sys 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "libz-sys 1.0.12 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -172,7 +176,7 @@ dependencies = [ "cmake 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", "libz-sys 1.0.12 (registry+https://github.com/rust-lang/crates.io-index)", - "openssl-sys 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -181,7 +185,7 @@ name = "libz-sys" version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gcc 0.3.41 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.43 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -205,31 +209,29 @@ dependencies = [ ] [[package]] -name = "metadeps" -version = "1.1.1" +name = "memchr" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "error-chain 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "toml 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "mowl" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", - "term 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "term 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "nom" -version = "2.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -279,12 +281,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "openssl-sys" -version = "0.9.6" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ + "gcc 0.3.43 (registry+https://github.com/rust-lang/crates.io-index)", "gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", - "metadeps 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "user32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -294,6 +297,11 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] +name = "quote" +version = "0.3.12" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] name = "rand" version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -330,23 +338,67 @@ dependencies = [ ] [[package]] +name = "regex" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "aho-corasick 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "thread_local 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] name = "regex-syntax" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "rustc-serialize" -version = "0.3.22" +name = "regex-syntax" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] +name = "serde" +version = "0.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "serde_codegen_internals" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "syn 0.11.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "serde_derive" +version = "0.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "quote 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_codegen_internals 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.11.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] name = "strsim" -version = "0.5.2" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] +name = "syn" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "quote 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] name = "term" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -355,7 +407,7 @@ dependencies = [ [[package]] name = "term_size" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -373,6 +425,15 @@ dependencies = [ ] [[package]] +name = "thread-id" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.20 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] name = "thread_local" version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -381,6 +442,15 @@ dependencies = [ ] [[package]] +name = "thread_local" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "thread-id 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unreachable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] name = "time" version = "0.1.36" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -393,15 +463,15 @@ dependencies = [ [[package]] name = "toml" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "unicode-bidi" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -409,12 +479,12 @@ dependencies = [ [[package]] name = "unicode-normalization" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "unicode-segmentation" -version = "0.1.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -423,8 +493,21 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] +name = "unicode-xid" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "unreachable" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] name = "url" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "idna 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -446,11 +529,21 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] +name = "utf8-ranges" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] name = "vec_map" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] name = "winapi" version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -467,17 +560,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [metadata] "checksum aho-corasick 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ca972c2ea5f742bfce5687b9aef75506a764f61d37f8f649047846a9686ddb66" +"checksum aho-corasick 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0638fd549427caa90c499814196d1b9e3725eb4d15d7339d6de073a680ed0ca2" "checksum ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "23ac7c30002a5accbf7e8987d0632fa6de155b7c3d39d0067317a391e00a2ef6" "checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" -"checksum chrono 0.2.25 (registry+https://github.com/rust-lang/crates.io-index)" = "9213f7cd7c27e95c2b57c49f0e69b1ea65b27138da84a170133fd21b07659c00" -"checksum clap 2.19.3 (registry+https://github.com/rust-lang/crates.io-index)" = "95b78f3fe0fc94c13c731714363260e04b557a637166f33a4570d3189d642374" +"checksum chrono 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "158b0bd7d75cbb6bf9c25967a48a2e9f77da95876b858eadfabaa99cd069de6e" +"checksum clap 2.20.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f89819450aa94325998aa83ce7ea142db11ad24c725d6bc48459845e0d6d9f18" "checksum cmake 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "a3a6805df695087e7c1bcd9a82e03ad6fb864c8e67ac41b1348229ce5b7f0407" -"checksum curl-sys 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "218a149208e1f4e5f7e20f1d0ed1e9431a086a6b4333ff95dba82237be9c283a" +"checksum curl-sys 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "f78d6400c642b96137fe29ea8ecb75b8d6539a5c698572f9b8401e79b78f7443" "checksum deque 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1614659040e711785ed8ea24219140654da1729f3ec8a47a9719d041112fe7bf" -"checksum error-chain 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "318cb3c71ee4cdea69fdc9e15c173b245ed6063e1709029e8fd32525a881120f" -"checksum gcc 0.3.41 (registry+https://github.com/rust-lang/crates.io-index)" = "3689e1982a563af74960ae3a4758aa632bb8fd984cfc3cc3b60ee6109477ab6e" +"checksum gcc 0.3.43 (registry+https://github.com/rust-lang/crates.io-index)" = "c07c758b972368e703a562686adb39125707cc1ef3399da8c019fc6c2498a75d" "checksum gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0912515a8ff24ba900422ecda800b52f4016a56251922d397c576bf92c690518" -"checksum git2 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0534ca86640c6a3a0687cc6bee9ec4032509a0d112d97e8241fa6b7e075f6119" +"checksum git2 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "046ae03385257040b2a35e56d9669d950dd911ba2bf48202fbef73ee6aab27b2" "checksum idna 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1053236e00ce4f668aeca4a769a09b3bf5a682d802abd6f3cb39374f6b162c11" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum lazy_static 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6abe0ee2e758cd6bc8a2cd56726359007748fbf4128da998b65d0b70f881e19b" @@ -488,38 +581,50 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ab83497bf8bf4ed2a74259c1c802351fcd67a65baa86394b6ba73c36f4838054" "checksum matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "efd7622e3022e1a6eaa602c4cea8912254e5582c9c692e9167714182244801b1" "checksum memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d8b629fb514376c675b98c1421e80b151d3817ac42d7c667717d282761418d20" -"checksum metadeps 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "829fffe7ea1d747e23f64be972991bc516b2f1ac2ae4a3b33d8bea150c410151" -"checksum mowl 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5bcc01039a46cb0348ee8c3ab1a058565fd6aeee3f46fcf33f25a6b7039ec14f" -"checksum nom 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ffc564b2727f758993db55d4ffed0d84bbd7f387a66509516768c8f786bb0b10" +"checksum memchr 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1dbccc0e46f1ea47b9f17e6d67c5a96bd27030519c519c9c91327e31275a47b4" +"checksum mowl 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5d534de8dac6859f12095e500793358d84af27d87b0aadf080d0cb0bbe25cf2a" +"checksum nom 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e5d4598834859fedb9a0a69d5b862a970e77982a92f544d547257a4d49469067" "checksum num 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)" = "bde7c03b09e7c6a301ee81f6ddf66d7a28ec305699e3d3b056d2fc56470e3120" "checksum num-integer 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "fb24d9bfb3f222010df27995441ded1e954f8f69cd35021f6bef02ca9552fb92" "checksum num-iter 0.1.32 (registry+https://github.com/rust-lang/crates.io-index)" = "287a1c9969a847055e1122ec0ea7a5c5d6f72aad97934e131c83d5c08ab4e45c" "checksum num-traits 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)" = "a16a42856a256b39c6d3484f097f6713e14feacd9bfb02290917904fae46c81c" "checksum num_cpus 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a225d1e2717567599c24f88e49f00856c6e825a12125181ee42c4257e3688d39" "checksum openssl-probe 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "756d49c8424483a3df3b5d735112b4da22109ced9a8294f1f5cdf80fb3810919" -"checksum openssl-sys 0.9.6 (registry+https://github.com/rust-lang/crates.io-index)" = "b1482f9a06f56c906007e17ea14d73d102210b5d27bc948bf5e175f493f3f7c3" +"checksum openssl-sys 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)" = "5dd48381e9e8a6dce9c4c402db143b2e243f5f872354532f7a009c289b3998ca" "checksum pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3a8b4c6b8165cd1a1cd4b9b120978131389f64bdaf456435caa41e630edba903" +"checksum quote 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)" = "e7b44fd83db28b83c1c58187159934906e5e955c812e211df413b76b03c909a5" "checksum rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "022e0636ec2519ddae48154b028864bdce4eaf7d35226ab8e65c611be97b189d" "checksum rayon 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "50c575b58c2b109e2fbc181820cbe177474f35610ff9e357dc75f6bac854ffbf" "checksum redox_syscall 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "8dd35cc9a8bdec562c757e3d43c1526b5c6d2653e23e2315065bc25556550753" "checksum regex 0.1.80 (registry+https://github.com/rust-lang/crates.io-index)" = "4fd4ace6a8cf7860714a2c2280d6c1f7e6a413486c13298bbc86fd3da019402f" +"checksum regex 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4278c17d0f6d62dfef0ab00028feb45bd7d2102843f80763474eeb1be8a10c01" "checksum regex-syntax 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "f9ec002c35e86791825ed294b50008eea9ddfc8def4420124fbc6b08db834957" -"checksum rustc-serialize 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)" = "237546c689f20bb44980270c73c3b9edd0891c1be49cc1274406134a66d3957b" -"checksum strsim 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "67f84c44fbb2f91db7fef94554e6b2ac05909c9c0b0bc23bb98d3a1aebfe7f7c" -"checksum term 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3deff8a2b3b6607d6d7cc32ac25c0b33709453ca9cceac006caac51e963cf94a" -"checksum term_size 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3f7f5f3f71b0040cecc71af239414c23fd3c73570f5ff54cf50e03cef637f2a0" +"checksum regex-syntax 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9191b1f57603095f105d317e375d19b1c9c5c3185ea9633a99a6dcbed04457" +"checksum serde 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)" = "1e0ed773960f90a78567fcfbe935284adf50c5d7cf119aa2cf43bb0b4afa69bb" +"checksum serde_codegen_internals 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c3172bf2940b975c0e4f6ab42a511c0a4407d4f46ccef87a9d3615db5c26fa96" +"checksum serde_derive 0.9.7 (registry+https://github.com/rust-lang/crates.io-index)" = "6af30425c5161deb200aac4803c62b903eb3be7e889c5823d0e16c4ce0ce989c" +"checksum strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b4d15c810519a91cf877e7e36e63fe068815c678181439f2f29e2562147c3694" +"checksum syn 0.11.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f4f94368aae82bb29656c98443a7026ca931a659e8d19dcdc41d6e273054e820" +"checksum term 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d168af3930b369cfe245132550579d47dfd873d69470755a19c2c6568dbbd989" +"checksum term_size 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "71662702fe5cd2cf95edd4ad655eea42f24a87a0e44059cbaa4e55260b7bc331" "checksum thread-id 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a9539db560102d1cef46b8b78ce737ff0bb64e7e18d35b2a5688f7d097d0ff03" +"checksum thread-id 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4437c97558c70d129e40629a5b385b3fb1ffac301e63941335e4d354081ec14a" "checksum thread_local 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "8576dbbfcaef9641452d5cf0df9b0e7eeab7694956dd33bb61515fb8f18cfdd5" +"checksum thread_local 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7793b722f0f77ce716e7f1acf416359ca32ff24d04ffbac4269f44a4a83be05d" "checksum time 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)" = "211b63c112206356ef1ff9b19355f43740fc3f85960c598a93d3a3d3ba7beade" -"checksum toml 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "736b60249cb25337bc196faa43ee12c705e426f3d55c214d73a4e7be06f92cb4" -"checksum unicode-bidi 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b61814f3e7fd0e0f15370f767c7c943e08bc2e3214233ae8f88522b334ceb778" -"checksum unicode-normalization 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "5e94e9f6961090fcc75180629c4ef33e5310d6ed2c0dd173f4ca63c9043b669e" -"checksum unicode-segmentation 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c3bc443ded17b11305ffffe6b37e2076f328a5a8cb6aa877b1b98f77699e98b5" +"checksum toml 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "08272367dd2e766db3fa38f068067d17aa6a9dfd7259af24b3927db92f1e0c2f" +"checksum unicode-bidi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d3a078ebdd62c0e71a709c3d53d2af693fe09fe93fbff8344aebe289b78f9032" +"checksum unicode-normalization 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "e28fa37426fceeb5cf8f41ee273faa7c82c47dc8fba5853402841e665fcd86ff" +"checksum unicode-segmentation 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "18127285758f0e2c6cf325bb3f3d138a12fee27de4f23e146cd6a179f26c2cf3" "checksum unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "bf3a113775714a22dcb774d8ea3655c53a32debae63a063acc00a91cc586245f" -"checksum url 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cbcb1997952b5a73b438a90940834621a8002e59640a8d92a1c05ef8fa58a1da" +"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" +"checksum unreachable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1f2ae5ddb18e1c92664717616dd9549dde73f539f01bd7b77c2edb2446bdff91" +"checksum url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f5ba8a749fb4479b043733416c244fa9d1d3af3d7c23804944651c8a448cb87e" "checksum user32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ef4711d107b21b410a3a974b1204d9accc8b10dad75d8324b5d755de1617d47" "checksum utf8-ranges 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a1ca13c08c41c9c3e04224ed9ff80461d97e121589ff27c753a16cb10830ae0f" +"checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122" "checksum vec_map 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cac5efe5cb0fa14ec2f84f83c701c562ee63f6dcc680861b21d65c682adfb05f" +"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" "checksum yaml-rust 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e66366e18dc58b46801afbf2ca7661a9f59cc8c5962c29892b6039b4f86fa992" @@ -1,6 +1,6 @@ [package] name = "git-journal" -version = "1.3.3" +version = "1.4.0" license = "MIT" readme = "README.md" keywords = ["parser", "git", "log", "changelog", "journal"] @@ -10,7 +10,6 @@ homepage = "https://github.com/saschagrunert/git-journal" documentation = "https://docs.rs/git-journal" description = "The Git Commit Message and Changelog Generation Framework" categories = ["command-line-utilities"] -license-file = "LICENSE" [badges] travis-ci = { repository = "saschagrunert/git-journal", branch = "master" } @@ -29,7 +28,8 @@ mowl = "1" nom = { version = "2", features = ["regexp_macros"] } regex = "0.1" rayon = "0" -rustc-serialize = "0" +serde = "0" +serde_derive = "0" term = "0" toml = "0" diff --git a/benches/bench.rs b/benches/bench.rs index 18811ff..8192d17 100644 --- a/benches/bench.rs +++ b/benches/bench.rs @@ -8,16 +8,12 @@ use gitjournal::GitJournal; #[bench] fn verify_huge_message(b: &mut Bencher) { let journal = GitJournal::new(".").unwrap(); - b.iter(|| { - journal.verify("./tests/commit_messages/success_huge").is_ok(); - }); + b.iter(|| { journal.verify("./tests/commit_messages/success_huge").is_ok(); }); } #[bench] fn parse(b: &mut Bencher) { let mut journal = GitJournal::new(".").unwrap(); journal.config.enable_debug = false; - b.iter(|| { - journal.parse_log("HEAD", "rc", &0, &true, &false).is_ok(); - }); + b.iter(|| { journal.parse_log("HEAD", "rc", &0, &true, &false).is_ok(); }); } diff --git a/src/config.rs b/src/config.rs index 79208f9..b11c10f 100644 --- a/src/config.rs +++ b/src/config.rs @@ -2,8 +2,7 @@ //! [toml](https://github.com/toml-lang/toml) format with the file name `.gitjournal.toml`. //! -use rustc_serialize::Encodable; -use toml::{self, Encoder, Value, Parser, encode_str, decode}; +use toml; use std::fs::File; use std::path::PathBuf; @@ -12,13 +11,13 @@ use std::io::prelude::*; use errors::{GitJournalResult, error}; /// The configuration structure for git-journal. -#[derive(Default, Debug, Clone, PartialEq, RustcEncodable, RustcDecodable)] +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct Config { /// Specifies the available categories for the commit message pub categories: Vec<String>, /// Set the characters where the categories are wrapped in - pub category_delimiters: (String, String), + pub category_delimiters: Vec<String>, /// Set to false if the output should not be colored pub colored_output: bool, @@ -61,7 +60,7 @@ impl Config { pub fn new() -> Self { Config { categories: Self::get_default_categories(), - category_delimiters: ("[".to_owned(), "]".to_owned()), + category_delimiters: vec!["[".to_owned(), "]".to_owned()], colored_output: true, default_template: None, enable_debug: true, @@ -91,13 +90,15 @@ impl Config { /// When toml encoding or file creation failed. /// pub fn save_default_config(&self, path: &str) -> GitJournalResult<String> { - let mut encoder = Encoder::new(); - self.encode(&mut encoder)?; - let toml_string = encode_str(&Value::Table(encoder.toml)); + // Serialize self to toml + let toml_string = toml::to_string(&self).unwrap(); + info!("{:?}", toml_string); + // Get the correct path let path_buf = self.get_path_with_filename(path); let path_string = path_buf.to_str().ok_or(error("IO", "Cannot convert path to string"))?; + // Write the path to string let mut file = File::create(&path_buf)?; file.write_all(toml_string.as_bytes())?; Ok(path_string.to_owned()) @@ -117,14 +118,12 @@ impl Config { /// pub fn load(&mut self, path: &str) -> GitJournalResult<()> { let path_buf = self.get_path_with_filename(path); - let mut file = File::open(path_buf)?; + let mut file = File::open(&path_buf)?; let mut toml_string = String::new(); file.read_to_string(&mut toml_string)?; - let toml = Parser::new(&toml_string).parse() - .ok_or(toml::Error::Custom("Could not parse toml configuration.".to_owned()))?; - *self = - decode(Value::Table(toml)).ok_or(toml::Error::Custom("Could not decode toml configuration.".to_owned()))?; + // Deserialize the toml string + *self = toml::from_str(&toml_string)?; // If the categories are not found within the toml it will return an empty array // which will break the parser. So use the default ones instead. @@ -22,12 +22,15 @@ extern crate chrono; extern crate git2; +extern crate mowl; extern crate rayon; extern crate regex; -extern crate rustc_serialize; +extern crate serde; extern crate term; extern crate toml; -extern crate mowl; + +#[macro_use] +extern crate serde_derive; #[macro_use] extern crate nom; @@ -294,16 +297,14 @@ impl GitJournal { // Write the new generated content to the file let mut file = OpenOptions::new().write(true).open(path)?; let mut old_msg_vec = commit_message.lines() - .filter_map(|line| { - if !line.is_empty() { - if line.starts_with('#') { - Some(line.to_owned()) - } else { - Some("# ".to_owned() + line) - } + .filter_map(|line| if !line.is_empty() { + if line.starts_with('#') { + Some(line.to_owned()) } else { - None + Some("# ".to_owned() + line) } + } else { + None }) .collect::<Vec<_>>(); if !old_msg_vec.is_empty() { @@ -355,9 +356,8 @@ impl GitJournal { let mut toml_string = String::new(); file.read_to_string(&mut toml_string)?; - let toml = toml::Parser::new(&toml_string).parse() - .ok_or(error("Verify", "Could not parse default toml template."))?; - + // Deserialize the toml + let toml = toml::from_str(&toml_string)?; let toml_tags = self.parser.get_tags_from_toml(&toml, vec![]); let invalid_tags = tags.into_iter().filter(|tag| !toml_tags.contains(tag)).collect::<Vec<String>>(); if !invalid_tags.is_empty() { @@ -473,13 +473,12 @@ impl GitJournal { } // Process with the full CPU power - worker_vec.par_iter_mut().for_each(|&mut (ref message, ref oid, ref mut result)| { - match self.parser.parse_commit_message(message, Some(*oid)) { - Ok(parsed_message) => { - *result = Some(parsed_message); - } - Err(e) => warn!("Skipping commit: {}", e), + worker_vec.par_iter_mut().for_each(|&mut (ref message, ref oid, ref mut result)| match self.parser + .parse_commit_message(message, Some(*oid)) { + Ok(parsed_message) => { + *result = Some(parsed_message); } + Err(e) => warn!("Skipping commit: {}", e), }); // Assemble results together via the message_id @@ -566,7 +565,7 @@ impl GitJournal { // Write toml to file let mut path_buf = PathBuf::from(&self.path); path_buf.push("template.toml"); - let toml_string = toml::encode_str(&toml); + let toml_string = toml::to_string(&toml)?; let mut toml_file = File::create(&path_buf)?; toml_file.write_all(toml_string.as_bytes())?; @@ -645,7 +644,7 @@ mod tests { } #[test] |