chore: Update liquid to 0.20

Signed-off-by: Igor Raits <i.gnatenko.brain@gmail.com>
This commit is contained in:
Igor Raits 2020-03-22 16:27:35 +01:00 committed by David Peter
parent 5edd8260e8
commit 136a745c5d
5 changed files with 67 additions and 110 deletions

View File

@ -33,15 +33,15 @@ matrix:
# Minimum Rust supported channel.
- os: linux
rust: 1.36.0
rust: 1.37.0
env: TARGET=x86_64-unknown-linux-gnu
- os: linux
rust: 1.36.0
rust: 1.37.0
env:
- TARGET=x86_64-unknown-linux-musl
- CC_x86_64_unknown_linux_musl=/usr/bin/musl-gcc
- os: osx
rust: 1.36.0
rust: 1.37.0
env: TARGET=x86_64-apple-darwin
# Disable nightly for now

136
Cargo.lock generated
View File

@ -129,7 +129,7 @@ dependencies = [
"git2 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)",
"globset 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"liquid 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
"liquid 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)",
"shell-words 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"syntect 3.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
@ -333,11 +333,6 @@ dependencies = [
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "deunicode"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "difference"
version = "2.0.0"
@ -629,6 +624,14 @@ dependencies = [
"winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "kstring"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "lazy_static"
version = "1.4.0"
@ -690,78 +693,56 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "liquid"
version = "0.19.0"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"chrono 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)",
"deunicode 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"doc-comment 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"liquid-compiler 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
"liquid-derive 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
"liquid-error 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
"liquid-interpreter 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
"liquid-value 0.19.1 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 1.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"kstring 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"liquid-core 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)",
"liquid-derive 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)",
"liquid-lib 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-segmentation 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "liquid-compiler"
version = "0.19.0"
name = "liquid-core"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"anymap 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)",
"chrono 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)",
"itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
"liquid-error 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
"liquid-interpreter 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
"liquid-value 0.19.1 (registry+https://github.com/rust-lang/crates.io-index)",
"kstring 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"liquid-derive 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
"pest 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"pest_derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "liquid-derive"
version = "0.19.0"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"liquid-compiler 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
"liquid-error 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
"liquid-interpreter 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
"liquid-value 0.19.1 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-quote 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-quote 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "liquid-error"
version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "liquid-interpreter"
version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"anymap 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)",
"itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
"liquid-error 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
"liquid-value 0.19.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "liquid-value"
version = "0.19.1"
name = "liquid-lib"
version = "0.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"chrono 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)",
"itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
"liquid-error 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.105 (registry+https://github.com/rust-lang/crates.io-index)",
"kstring 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"liquid-core 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)",
"once_cell 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 1.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-segmentation 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -821,6 +802,11 @@ dependencies = [
"autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "once_cell"
version = "1.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "onig"
version = "5.0.0"
@ -965,24 +951,24 @@ dependencies = [
[[package]]
name = "proc-quote"
version = "0.2.2"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro-hack 0.5.14 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-quote-impl 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-quote-impl 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "proc-quote-impl"
version = "0.2.2"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro-hack 0.5.14 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -1171,16 +1157,6 @@ name = "strsim"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "syn"
version = "0.15.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "syn"
version = "1.0.17"
@ -1484,7 +1460,6 @@ dependencies = [
"checksum content_inspector 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b7bda66e858c683005a53a9a60c69a4aca7eeaa45d124526e389f7aec8e62f38"
"checksum crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1"
"checksum crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8"
"checksum deunicode 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "307dde1a517939465bc4042b47377284a56cee6160f8066f1f5035eb7b25a3fc"
"checksum difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198"
"checksum digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5"
"checksum dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "13aea89a5c93364a98e9b37b2fa237effbb694d5cfe01c5b70941f7eb087d5e3"
@ -1521,6 +1496,7 @@ dependencies = [
"checksum itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e"
"checksum jobserver 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "5c71313ebb9439f74b00d9d2dcec36440beaf57a6aa0623068441dd7cd81a7f2"
"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
"checksum kstring 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6382df53100fd22e149030b6634720c94a151076db8d727b3274d7070975d609"
"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
"checksum lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f"
"checksum libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)" = "dea0c0405123bba743ee3f91f49b1c7cfb684eef0da0a50110f758ccf24cdff0"
@ -1529,12 +1505,10 @@ dependencies = [
"checksum libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "2eb5e43362e38e2bca2fd5f5134c4d4564a23a5c28e9b95411652021a8675ebe"
"checksum line-wrap 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f30344350a2a51da54c1d53be93fade8a237e545dbcc4bdbe635413f2117cab9"
"checksum linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83"
"checksum liquid 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c7cf7f28965f50ff06e2e9f26162f6d944b71f976506a7a01a6308ddebd36155"
"checksum liquid-compiler 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7cd195c00674a2dc811b07969358c97c0639db4a73bc61514db48609d110356f"
"checksum liquid-derive 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5b0faadd0dd1a7cf38390316c36a9a741949462750f9833b794ac6d7de145218"
"checksum liquid-error 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7d5c0851812322e87dcf67c2d7e520c3efd8651bd44eb8d0c0246e6dfb94d481"
"checksum liquid-interpreter 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)" = "998e0411b8cb6210bb0729ccbb15abd2a1c8ef7e318c97511ae5a741c817c63e"
"checksum liquid-value 0.19.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2f56016187fb289186fccf44a9ae840f7b9ba35a04fd611e591aed2a1f53c265"
"checksum liquid 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)" = "62b5a51d24120bc37da30a3bcd741ede7450f00e9fcb0b8648a1d25f7736bc6e"
"checksum liquid-core 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3a922402825d7fd1965364e1d289f909076bcf580e5ae4a5edaf82af1fe7a9dc"
"checksum liquid-derive 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e6fcb48d443dbc49c65b3e5aaecc95e6e911a28b20049d6ac2d94527543fa133"
"checksum liquid-lib 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0629fbd25a919496d2e621e8a3af892bc438273d0f446eb4f0d66ce45117d15d"
"checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7"
"checksum maplit 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d"
"checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08"
@ -1543,6 +1517,7 @@ dependencies = [
"checksum nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6"
"checksum num-integer 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "3f6ea62e9d81a77cd3ee9a2a5b9b609447857f3d358704331e4ef39eb247fcba"
"checksum num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096"
"checksum once_cell 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b1c601810575c99596d4afc46f78a678c80105117c379eb3650cf99b8a21ce5b"
"checksum onig 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e4e723fc996fff1aeab8f62205f3e8528bf498bdd5eadb2784d2d31f30077947"
"checksum onig_sys 69.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0a8d4efbf5f59cece01f539305191485b651acb3785b9d5eef05749f0496514e"
"checksum opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c"
@ -1561,8 +1536,8 @@ dependencies = [
"checksum proc-macro-hack 0.5.14 (registry+https://github.com/rust-lang/crates.io-index)" = "fcfdefadc3d57ca21cf17990a28ef4c0f7c61383a28cb7604cf4a18e6ede1420"
"checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759"
"checksum proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6c09721c6781493a2a492a96b5a5bf19b65917fe6728884e7c44dd0c60ca3435"
"checksum proc-quote 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "fa612543f23fda013e1e6ce30b5285a9d313c6e582e57b4ceca74eb5b85685b5"
"checksum proc-quote-impl 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f785f0f8cd00b7945efc3f3bdf8205eb06af5aacec598d83e67f41dc8d101fda"
"checksum proc-quote 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d8fe0b6f6aef22a400495cdabfd44389b8d5cf71407680fe031be86e51296c85"
"checksum proc-quote-impl 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "66d3ed99337a9586d312fcd7240546abd644b095a5bd1d1809d82c6ae6d16a8c"
"checksum quick-error 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
"checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1"
"checksum quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2bdc6c187c65bca4260c9011c9e3132efe4909da44726bad24cf7572ae338d7f"
@ -1588,7 +1563,6 @@ dependencies = [
"checksum shlex 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2"
"checksum smallvec 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5c2fb2ec9bcd216a5b0d0ccf31ab17b5ed1d627960edff65bbe95d3ce221cefc"
"checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
"checksum syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)" = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5"
"checksum syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)" = "0df0eb663f387145cab623dea85b09c2c5b4b0aef44e945d928e682fce71bb03"
"checksum syntect 3.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "955e9da2455eea5635f7032fc3a229908e6af18c39600313866095e07db0d8b8"
"checksum tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8"

View File

@ -55,7 +55,7 @@ assert_cmd = "0.12.0"
[build-dependencies]
clap = "2.33"
liquid = "0.19"
liquid = "0.20"
lazy_static = "1.4"
[profile.release]

View File

@ -341,7 +341,7 @@ binaries are also available: look for archives with `musl` in the file name.
### From source
If you want to build `bat` from source, you need Rust 1.36 or
If you want to build `bat` from source, you need Rust 1.37 or
higher. You can then use `cargo` to build everything:
```bash

View File

@ -18,34 +18,13 @@ lazy_static! {
.unwrap_or("bat");
}
fn init_template() -> liquid::value::Object {
let mut globals = liquid::value::Object::new();
globals.insert(
"PROJECT_NAME".into(),
liquid::value::Value::scalar(PROJECT_NAME.to_owned()),
);
globals.insert(
"PROJECT_EXECUTABLE".into(),
liquid::value::Value::scalar(EXECUTABLE_NAME.to_owned()),
);
globals.insert(
"PROJECT_VERSION".into(),
liquid::value::Value::scalar(PROJECT_VERSION.to_owned()),
);
globals
}
/// Generates a file from a liquid template.
fn template(
variables: &liquid::value::Object,
variables: &liquid::Object,
in_file: &str,
out_file: impl AsRef<Path>,
) -> Result<(), Box<dyn Error>> {
let template = liquid::ParserBuilder::with_liquid()
let template = liquid::ParserBuilder::with_stdlib()
.build()?
.parse(&fs::read_to_string(in_file)?)?;
@ -54,7 +33,11 @@ fn template(
}
fn main() -> Result<(), Box<dyn Error>> {
let variables = init_template();
let variables = liquid::object!({
"PROJECT_NAME": PROJECT_NAME.to_owned(),
"PROJECT_EXECUTABLE": EXECUTABLE_NAME.to_owned(),
"PROJECT_VERSION": PROJECT_VERSION.to_owned(),
});
let out_dir_env = std::env::var_os("OUT_DIR").expect("OUT_DIR to be set in build.rs");
let out_dir = Path::new(&out_dir_env);