summaryrefslogtreecommitdiffstats
path: root/vendor/similar
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
commit9835e2ae736235810b4ea1c162ca5e65c547e770 (patch)
tree3fcebf40ed70e581d776a8a4c65923e8ec20e026 /vendor/similar
parentReleasing progress-linux version 1.70.0+dfsg2-1~progress7.99u1. (diff)
downloadrustc-9835e2ae736235810b4ea1c162ca5e65c547e770.tar.xz
rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.zip
Merging upstream version 1.71.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/similar')
-rw-r--r--vendor/similar/.cargo-checksum.json2
-rw-r--r--vendor/similar/CHANGELOG.md10
-rw-r--r--vendor/similar/Cargo.lock88
-rw-r--r--vendor/similar/Cargo.toml57
-rw-r--r--vendor/similar/README.md10
-rw-r--r--vendor/similar/src/algorithms/lcs.rs16
-rw-r--r--vendor/similar/src/algorithms/myers.rs2
-rw-r--r--vendor/similar/src/algorithms/snapshots/similar__algorithms__lcs__same.snap12
-rw-r--r--vendor/similar/src/algorithms/utils.rs2
-rw-r--r--vendor/similar/src/text/mod.rs25
-rw-r--r--vendor/similar/src/udiff.rs2
-rw-r--r--vendor/similar/src/utils.rs4
12 files changed, 165 insertions, 65 deletions
diff --git a/vendor/similar/.cargo-checksum.json b/vendor/similar/.cargo-checksum.json
index 1fedba002..97377f246 100644
--- a/vendor/similar/.cargo-checksum.json
+++ b/vendor/similar/.cargo-checksum.json
@@ -1 +1 @@
-{"files":{"CHANGELOG.md":"e5751a2890f7f989e3a0946f5ae9d49714356d01217a6f666bd122de9c8ad3bd","Cargo.lock":"4a0a4935b4b6f7ee8e73b58f996c980b69de201bcb5a9e4e063103443fc677d5","Cargo.toml":"5912413a7c1b985cbc175d122ad73b6dccdaa83d4fbc934b7082fc803eeb8f98","LICENSE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","Makefile":"ca065f24256d6f9102b7dafc38a9bde4e04faf0ea585adc1e1dafbd4920cd90b","README.md":"27afe5f40b8b67ad596b9516aae09e68c6656198dfc53e4177c0b802094853c3","clippy.toml":"13ac28576f4d4b5235fb12c2bcdf682c02908fb9e60a0b62c19a96361ccc9a64","examples/close-matches.rs":"9c168c894453f7de5877955ea55362ed4e6ef637dd6c4b176645614258a29998","examples/large.rs":"6f46e6fb7aac8e043702a921c0615c17aceb2b0ea6d943210ab1d8e747c23da7","examples/nonstring.rs":"4c5765d66cafd6e81d4e678fc202faf1e220352e29d0715097ad3cb19d2d95c2","examples/original-slices.rs":"d2d0e3c04e04236b5d186622d3f587706c660d236fba00a38f06587823a01878","examples/patience.rs":"8ba9ed249e2ab531d6140e1b48314e392ab67387661d9c6268b1471c97edc1fb","examples/serde.rs":"d6f180d960c0ff2df0a1facec71310d4d8f8ba37d1b17639ad12d3b2f484415a","examples/terminal-inline.rs":"ebbd9b2194390dd6c4ced7693c7521ca64aa4e008a2ad98dbec8b35208a75ece","examples/terminal.rs":"bfffd6d1e930158e14732eec4fd0f62bce982c0dada7b62763057cef77fd4219","examples/udiff.rs":"8da4fd68e210358ae3fbe6a16731aa155c634096843c4a98b91a4b1284e5b7f1","src/algorithms/capture.rs":"6c1358baed6c927f86b20600aab9cccbce5b3b6ec92d7b9e6149f346ebab4794","src/algorithms/compact.rs":"bd6e5b07669808db2a4cab20e21b21db903fae42524954a57ce23411afcf7659","src/algorithms/hook.rs":"51459faf43c606d9b308723ca31d7118777e24b9afe1e9a98bc2ba90d6990799","src/algorithms/lcs.rs":"3c6c33d67ea50822e09fa7f109786165c3d4d125fb2d48bebc02b1c40d6476d0","src/algorithms/mod.rs":"d2a86b74d0e637c7e7b89cb87f22e6a1102759b43042bf8307b10b9f41d1b6a2","src/algorithms/myers.rs":"4b0f16c313aa7644ed9260fa6e0953268b54bfa772291bb4b726f6410f768a3a","src/algorithms/patience.rs":"275c1cf59a75c4ae290b90cc9665ebf36a5b403222e1f70fdda6be8d5127541a","src/algorithms/replace.rs":"88c3a4ca67c722d9886d6d21f6b174b5ce2b76b3a302f25c36c4dcdeda31f4e9","src/algorithms/snapshots/similar__algorithms__capture__capture_hook_grouping-2.snap":"accbd58fc63fd972c30a1060501ea3d1e51f0bb17d35b71cff98eab1358c8d81","src/algorithms/snapshots/similar__algorithms__capture__capture_hook_grouping.snap":"16fe0debab61a2be05aeee7081b3f1ce54b055560fc641672374ba23d316c9a1","src/algorithms/snapshots/similar__algorithms__lcs__contiguous.snap":"81f60b2b1939c503aaa2861b1e2fa62ff6a29202d110e48324a62d13dac7b68c","src/algorithms/snapshots/similar__algorithms__lcs__diff.snap":"5f34e634b931b5b9af25328e0780b5e01c8b26c66424774eb951b7a9f13728b6","src/algorithms/snapshots/similar__algorithms__lcs__pat.snap":"791647906f36a1effdeb5bde5625b5188447439ba234d93b64e75b1d87f13ab3","src/algorithms/snapshots/similar__algorithms__myers__contiguous.snap":"a65c392c570d732b3a26e1b06022de9fa17127ce5b341ce9b1d91f9e3c435438","src/algorithms/snapshots/similar__algorithms__myers__deadline_reached.snap":"fa7d71f326a1650e10604227358a303f4ecc7989e46b8b9a4d1ae345044183ce","src/algorithms/snapshots/similar__algorithms__myers__diff.snap":"28549b646e1395d57b9c9d9c359b890bd68be4f4df83800ac9680398c5cc5181","src/algorithms/snapshots/similar__algorithms__myers__pat.snap":"90585b8385a3aa073faecf90cac30360389a51d28030b99e819483f016be7f34","src/algorithms/snapshots/similar__algorithms__patience__patience.snap":"1ff007b11ebd3f7781781145b37eba9d38e4e2d87e337dd9c669c7e806b414e3","src/algorithms/snapshots/similar__algorithms__patience__patience_out_of_bounds_bug.snap":"21252d8b50186f226cadab72a1bd023ca40170889267474c6bc23f979d20aa3b","src/algorithms/utils.rs":"f6a25d5eb1dcb38952b3269c388146ade30bd2b3e77147dfabe94eda318d64b6","src/common.rs":"9455852ea42f8e1ed288331b7ce91120e586f350cee46ec3251397aade7dd5b6","src/iter.rs":"a76d3ad83c924eb7fdb96d5a9ff5209ef5917d6ce2774db6d3f8a7ccb3da75d3","src/lib.rs":"4a692345b1f26edac3b22e8f5d6e80bf497f08fc9da10556bb3dbbbf87c162cc","src/snapshots/similar__udiff__unified_diff.snap":"228b01fd9d21522459f420fe4f7e663cf187903456e050dda6ab2c60dce5828c","src/snapshots/similar__udiff__unified_diff_newline_hint-2.snap":"0b699a1e6488df68eae42e682656f39f74f120245134829f7536aa0f2b84c4f9","src/snapshots/similar__udiff__unified_diff_newline_hint.snap":"97c2e42a6d1b7184f0d97dff02807f6b78c159de1df6bc616b0842db13eb945c","src/text/abstraction.rs":"5d86fe6c96a7a6993162982c37bd585b13bc369080918b872755cf21d5cb155e","src/text/inline.rs":"6f73f3e71ab246308469350df9e097c7ad2c7af5a60228710780b90cab8b1835","src/text/mod.rs":"ab6ae1e95ec28e5f4edca2031e2c7a0ae1db49dd3078e27c0883d41f88829b3e","src/text/snapshots/similar__text__captured_ops.snap":"e998dccc8d267f1aa20a202c01417945147dbf6f76f80f58a7cd73affcfa0328","src/text/snapshots/similar__text__captured_word_ops.snap":"369f37aa2e5fa62427fccdc5c06214ed45872645c6234388872d0697c39a17e6","src/text/snapshots/similar__text__char_diff.snap":"b0f22a6348287309bab42e0bcdb1006506bac12bf5d40beed927844f7d13ad2d","src/text/snapshots/similar__text__inline__line_ops_inline.snap":"a753d6c8e82819eb82974c3ab0b86ef952258a987ae40a52e9d7ea105c3c4c0c","src/text/snapshots/similar__text__inline__serde.snap":"b16f70957514ba6bbbcd16c8276bade62be896792f4cf410ca4170ade8e49c53","src/text/snapshots/similar__text__lifetimes_on_iter.snap":"8e61bf92359657a3e8473bffb2e0d15f0236fd2060b240b97ada7d06315a51d1","src/text/snapshots/similar__text__line_ops.snap":"40a2ee5e1eb901cb9409179975f71ba7dc99484ad5b955948d3bd80b6e2e77d3","src/text/snapshots/similar__text__serde.snap":"1b3f1c45f8efa5d598d362c5a34338f7434d1fa412d51398bd933e7d9b7157d3","src/text/snapshots/similar__text__serde_ops.snap":"07f94abf19f845a31a2ffc4635a9e8c12d767cb8a708636f317c3d354753fb22","src/text/snapshots/similar__text__unified_diff.snap":"1d7f48735fc21145425f5c975dfbbe3700db731847dad7c5d5bc17422fc3f424","src/text/snapshots/similar__text__virtual_newlines.snap":"5902123c4c4ec6250bdef56b1108ee0e8be1720d3f6dd9e4141a260cb0428b3e","src/text/utils.rs":"14310f63fff6679a4bcb323caba8da2806d1eb519613d1cfaf2eff564978f398","src/types.rs":"85920291ef279aac354577edcf980f8ae998a460b443a418432512de763aad9b","src/udiff.rs":"15d59f2fc8e445a30f2582fc2e458b2ecd3a4bd3e5165d0d38ec386e41e1f44c","src/utils.rs":"e38f71288890497a3fbf4f501c66be90c39560c1765b19770f418f86ba895e45"},"package":"2e24979f63a11545f5f2c60141afe249d4f19f84581ea2138065e400941d83d3"} \ No newline at end of file
+{"files":{"CHANGELOG.md":"5a3768a8953448faf56617249a4e50c081cc755cd47db14f6cab07a27ef28551","Cargo.lock":"63791f2f53ae158d53c21b8d7cde870bfd127a8a6803cf69d700f0e4f6e67544","Cargo.toml":"2b96c680aa3c27e4cdc44c801a4fdf54e9e23f97928922e94c173d00660888cb","LICENSE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","Makefile":"ca065f24256d6f9102b7dafc38a9bde4e04faf0ea585adc1e1dafbd4920cd90b","README.md":"a6f7bb89c55e8b9dd3f69fd5ec18ffff36c4f96ab7ff7cdab04514f40a09317f","clippy.toml":"13ac28576f4d4b5235fb12c2bcdf682c02908fb9e60a0b62c19a96361ccc9a64","examples/close-matches.rs":"9c168c894453f7de5877955ea55362ed4e6ef637dd6c4b176645614258a29998","examples/large.rs":"6f46e6fb7aac8e043702a921c0615c17aceb2b0ea6d943210ab1d8e747c23da7","examples/nonstring.rs":"4c5765d66cafd6e81d4e678fc202faf1e220352e29d0715097ad3cb19d2d95c2","examples/original-slices.rs":"d2d0e3c04e04236b5d186622d3f587706c660d236fba00a38f06587823a01878","examples/patience.rs":"8ba9ed249e2ab531d6140e1b48314e392ab67387661d9c6268b1471c97edc1fb","examples/serde.rs":"d6f180d960c0ff2df0a1facec71310d4d8f8ba37d1b17639ad12d3b2f484415a","examples/terminal-inline.rs":"ebbd9b2194390dd6c4ced7693c7521ca64aa4e008a2ad98dbec8b35208a75ece","examples/terminal.rs":"bfffd6d1e930158e14732eec4fd0f62bce982c0dada7b62763057cef77fd4219","examples/udiff.rs":"8da4fd68e210358ae3fbe6a16731aa155c634096843c4a98b91a4b1284e5b7f1","src/algorithms/capture.rs":"6c1358baed6c927f86b20600aab9cccbce5b3b6ec92d7b9e6149f346ebab4794","src/algorithms/compact.rs":"bd6e5b07669808db2a4cab20e21b21db903fae42524954a57ce23411afcf7659","src/algorithms/hook.rs":"51459faf43c606d9b308723ca31d7118777e24b9afe1e9a98bc2ba90d6990799","src/algorithms/lcs.rs":"fc33b03575f9408303fb3c8377ffd1978296dbcac849b85ad0f9557b99af630f","src/algorithms/mod.rs":"d2a86b74d0e637c7e7b89cb87f22e6a1102759b43042bf8307b10b9f41d1b6a2","src/algorithms/myers.rs":"945492e6f319e82a195ac8e1de429e9284dc891cf7e38d7f2c32576592352746","src/algorithms/patience.rs":"275c1cf59a75c4ae290b90cc9665ebf36a5b403222e1f70fdda6be8d5127541a","src/algorithms/replace.rs":"88c3a4ca67c722d9886d6d21f6b174b5ce2b76b3a302f25c36c4dcdeda31f4e9","src/algorithms/snapshots/similar__algorithms__capture__capture_hook_grouping-2.snap":"accbd58fc63fd972c30a1060501ea3d1e51f0bb17d35b71cff98eab1358c8d81","src/algorithms/snapshots/similar__algorithms__capture__capture_hook_grouping.snap":"16fe0debab61a2be05aeee7081b3f1ce54b055560fc641672374ba23d316c9a1","src/algorithms/snapshots/similar__algorithms__lcs__contiguous.snap":"81f60b2b1939c503aaa2861b1e2fa62ff6a29202d110e48324a62d13dac7b68c","src/algorithms/snapshots/similar__algorithms__lcs__diff.snap":"5f34e634b931b5b9af25328e0780b5e01c8b26c66424774eb951b7a9f13728b6","src/algorithms/snapshots/similar__algorithms__lcs__pat.snap":"791647906f36a1effdeb5bde5625b5188447439ba234d93b64e75b1d87f13ab3","src/algorithms/snapshots/similar__algorithms__lcs__same.snap":"99d00e41fa28c62340b0d5492d7708a605accb4cc1ddeab040d0fc5653ed37c1","src/algorithms/snapshots/similar__algorithms__myers__contiguous.snap":"a65c392c570d732b3a26e1b06022de9fa17127ce5b341ce9b1d91f9e3c435438","src/algorithms/snapshots/similar__algorithms__myers__deadline_reached.snap":"fa7d71f326a1650e10604227358a303f4ecc7989e46b8b9a4d1ae345044183ce","src/algorithms/snapshots/similar__algorithms__myers__diff.snap":"28549b646e1395d57b9c9d9c359b890bd68be4f4df83800ac9680398c5cc5181","src/algorithms/snapshots/similar__algorithms__myers__pat.snap":"90585b8385a3aa073faecf90cac30360389a51d28030b99e819483f016be7f34","src/algorithms/snapshots/similar__algorithms__patience__patience.snap":"1ff007b11ebd3f7781781145b37eba9d38e4e2d87e337dd9c669c7e806b414e3","src/algorithms/snapshots/similar__algorithms__patience__patience_out_of_bounds_bug.snap":"21252d8b50186f226cadab72a1bd023ca40170889267474c6bc23f979d20aa3b","src/algorithms/utils.rs":"6d6bf5429aae3cbe730e920e1e6b50503276d8a696a78127dcefc6a40b11d3f3","src/common.rs":"9455852ea42f8e1ed288331b7ce91120e586f350cee46ec3251397aade7dd5b6","src/iter.rs":"a76d3ad83c924eb7fdb96d5a9ff5209ef5917d6ce2774db6d3f8a7ccb3da75d3","src/lib.rs":"4a692345b1f26edac3b22e8f5d6e80bf497f08fc9da10556bb3dbbbf87c162cc","src/snapshots/similar__udiff__unified_diff.snap":"228b01fd9d21522459f420fe4f7e663cf187903456e050dda6ab2c60dce5828c","src/snapshots/similar__udiff__unified_diff_newline_hint-2.snap":"0b699a1e6488df68eae42e682656f39f74f120245134829f7536aa0f2b84c4f9","src/snapshots/similar__udiff__unified_diff_newline_hint.snap":"97c2e42a6d1b7184f0d97dff02807f6b78c159de1df6bc616b0842db13eb945c","src/text/abstraction.rs":"5d86fe6c96a7a6993162982c37bd585b13bc369080918b872755cf21d5cb155e","src/text/inline.rs":"6f73f3e71ab246308469350df9e097c7ad2c7af5a60228710780b90cab8b1835","src/text/mod.rs":"ee53855b7a512ed36955116c3d1feed9683a0d1ad50eb065e0bae74a09f984d4","src/text/snapshots/similar__text__captured_ops.snap":"e998dccc8d267f1aa20a202c01417945147dbf6f76f80f58a7cd73affcfa0328","src/text/snapshots/similar__text__captured_word_ops.snap":"369f37aa2e5fa62427fccdc5c06214ed45872645c6234388872d0697c39a17e6","src/text/snapshots/similar__text__char_diff.snap":"b0f22a6348287309bab42e0bcdb1006506bac12bf5d40beed927844f7d13ad2d","src/text/snapshots/similar__text__inline__line_ops_inline.snap":"a753d6c8e82819eb82974c3ab0b86ef952258a987ae40a52e9d7ea105c3c4c0c","src/text/snapshots/similar__text__inline__serde.snap":"b16f70957514ba6bbbcd16c8276bade62be896792f4cf410ca4170ade8e49c53","src/text/snapshots/similar__text__lifetimes_on_iter.snap":"8e61bf92359657a3e8473bffb2e0d15f0236fd2060b240b97ada7d06315a51d1","src/text/snapshots/similar__text__line_ops.snap":"40a2ee5e1eb901cb9409179975f71ba7dc99484ad5b955948d3bd80b6e2e77d3","src/text/snapshots/similar__text__serde.snap":"1b3f1c45f8efa5d598d362c5a34338f7434d1fa412d51398bd933e7d9b7157d3","src/text/snapshots/similar__text__serde_ops.snap":"07f94abf19f845a31a2ffc4635a9e8c12d767cb8a708636f317c3d354753fb22","src/text/snapshots/similar__text__unified_diff.snap":"1d7f48735fc21145425f5c975dfbbe3700db731847dad7c5d5bc17422fc3f424","src/text/snapshots/similar__text__virtual_newlines.snap":"5902123c4c4ec6250bdef56b1108ee0e8be1720d3f6dd9e4141a260cb0428b3e","src/text/utils.rs":"14310f63fff6679a4bcb323caba8da2806d1eb519613d1cfaf2eff564978f398","src/types.rs":"85920291ef279aac354577edcf980f8ae998a460b443a418432512de763aad9b","src/udiff.rs":"3ac5e608b4cf254da627c33a1bf12f46363bd041f4c137d15abb97bcfafcf196","src/utils.rs":"9a3b40b709c75a48a01ea9696ffa503360da672bab192be8b99f55cf2ea1a9c0"},"package":"420acb44afdae038210c99e69aae24109f32f15500aa708e81d46c9f29d55fcf"} \ No newline at end of file
diff --git a/vendor/similar/CHANGELOG.md b/vendor/similar/CHANGELOG.md
index ba72a26ca..929c66865 100644
--- a/vendor/similar/CHANGELOG.md
+++ b/vendor/similar/CHANGELOG.md
@@ -2,6 +2,14 @@
All notable changes to similar are documented here.
+## 2.2.1
+
+* Fixed a panic in LCS diffs on matching input. (#43)
+
+## 2.2.0
+
+* Fixed a panic in text diff generation. (#37)
+
## 2.1.0
* Removed deprecated alternative slice diffing functions.
@@ -16,7 +24,7 @@ All notable changes to similar are documented here.
## 1.3.0
* Performance improvements for the LCS algorithm.
-* Small performance improvments by adding an early opt-out for and inline highlighting.
+* Small performance improvements by adding an early opt-out for and inline highlighting.
* Added `IdentifyDistinct` to convert sequences to ints.
* Small performance improvements for larger text diffs by using `IdentifyDistinct`
automatically above a threshold.
diff --git a/vendor/similar/Cargo.lock b/vendor/similar/Cargo.lock
index 918fec9e8..f213d7d27 100644
--- a/vendor/similar/Cargo.lock
+++ b/vendor/similar/Cargo.lock
@@ -3,10 +3,16 @@
version = 3
[[package]]
+name = "autocfg"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
+
+[[package]]
name = "bstr"
-version = "0.2.16"
+version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90682c8d613ad3373e66de8c6411e0ae2ab2571e879d2efbf73558cc66f21279"
+checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223"
dependencies = [
"lazy_static",
"memchr",
@@ -15,13 +21,13 @@ dependencies = [
[[package]]
name = "console"
-version = "0.14.1"
+version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3993e6445baa160675931ec041a5e03ca84b9c6e32a056150d3aa2bdda0a1f45"
+checksum = "a28b32d32ca44b70c3e4acd7db1babf555fa026e385fb95f18028f88848b3c31"
dependencies = [
"encode_unicode",
- "lazy_static",
"libc",
+ "once_cell",
"regex",
"terminal_size",
"unicode-width",
@@ -41,25 +47,41 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f"
[[package]]
+name = "hashbrown"
+version = "0.11.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"
+
+[[package]]
+name = "indexmap"
+version = "1.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5"
+dependencies = [
+ "autocfg",
+ "hashbrown",
+]
+
+[[package]]
name = "insta"
-version = "1.7.1"
+version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c4a1b21a2971cea49ca4613c0e9fe8225ecaf5de64090fddc6002284726e9244"
+checksum = "b3cb858fc306825b542b1311d5fd536e4483680528f303a17a1d6803b0f6ce17"
dependencies = [
"console",
"lazy_static",
"serde",
"serde_json",
"serde_yaml",
- "similar 1.3.0",
+ "similar 2.1.0",
"uuid",
]
[[package]]
name = "itoa"
-version = "0.4.7"
+version = "0.4.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736"
+checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4"
[[package]]
name = "lazy_static"
@@ -69,9 +91,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]]
name = "libc"
-version = "0.2.98"
+version = "0.2.107"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "320cfe77175da3a483efed4bc0adc1968ca050b098ce4f2f1c13a56626128790"
+checksum = "fbe5e23404da5b4f555ef85ebed98fb4083e55a00c317800bc2a50ede9f3d219"
[[package]]
name = "linked-hash-map"
@@ -81,24 +103,30 @@ checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3"
[[package]]
name = "memchr"
-version = "2.4.0"
+version = "2.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc"
+checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a"
+
+[[package]]
+name = "once_cell"
+version = "1.9.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5"
[[package]]
name = "proc-macro2"
-version = "1.0.27"
+version = "1.0.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038"
+checksum = "ba508cc11742c0dc5c1659771673afbab7a0efab23aa17e854cbab0837ed0b43"
dependencies = [
"unicode-xid",
]
[[package]]
name = "quote"
-version = "1.0.9"
+version = "1.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7"
+checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05"
dependencies = [
"proc-macro2",
]
@@ -152,9 +180,9 @@ dependencies = [
[[package]]
name = "serde_json"
-version = "1.0.68"
+version = "1.0.70"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0f690853975602e1bfe1ccbf50504d67174e3bcf340f23b5ea9992e0587a52d8"
+checksum = "e277c495ac6cd1a01a58d0a0c574568b4d1ddf14f59965c6a58b8d96400b54f3"
dependencies = [
"itoa",
"ryu",
@@ -163,25 +191,25 @@ dependencies = [
[[package]]
name = "serde_yaml"
-version = "0.8.17"
+version = "0.8.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "15654ed4ab61726bf918a39cb8d98a2e2995b002387807fa6ba58fdf7f59bb23"
+checksum = "d8c608a35705a5d3cdc9fbe403147647ff34b921f8e833e49306df898f9b20af"
dependencies = [
"dtoa",
- "linked-hash-map",
+ "indexmap",
"serde",
"yaml-rust",
]
[[package]]
name = "similar"
-version = "1.3.0"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1ad1d488a557b235fc46dae55512ffbfc429d2482b08b4d9435ab07384ca8aec"
+checksum = "2e24979f63a11545f5f2c60141afe249d4f19f84581ea2138065e400941d83d3"
[[package]]
name = "similar"
-version = "2.1.0"
+version = "2.2.1"
dependencies = [
"bstr",
"console",
@@ -193,9 +221,9 @@ dependencies = [
[[package]]
name = "syn"
-version = "1.0.73"
+version = "1.0.81"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f71489ff30030d2ae598524f61326b902466f72a0fb1a8564c001cc63425bcc7"
+checksum = "f2afee18b8beb5a596ecb4a2dce128c719b4ba399d34126b9e4396e3f9860966"
dependencies = [
"proc-macro2",
"quote",
@@ -220,9 +248,9 @@ checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b"
[[package]]
name = "unicode-width"
-version = "0.1.8"
+version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3"
+checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973"
[[package]]
name = "unicode-xid"
diff --git a/vendor/similar/Cargo.toml b/vendor/similar/Cargo.toml
index 5f94e2f04..82938ded8 100644
--- a/vendor/similar/Cargo.toml
+++ b/vendor/similar/Cargo.toml
@@ -11,23 +11,39 @@
[package]
edition = "2018"
+rust-version = "1.41"
name = "similar"
-version = "2.1.0"
-authors = ["Armin Ronacher <armin.ronacher@active-4.com>", "Pierre-Étienne Meunier <pe@pijul.org>", "Brandon Williams <bwilliams.eng@gmail.com>"]
+version = "2.2.1"
+authors = [
+ "Armin Ronacher <armin.ronacher@active-4.com>",
+ "Pierre-Étienne Meunier <pe@pijul.org>",
+ "Brandon Williams <bwilliams.eng@gmail.com>",
+]
exclude = ["assets/*"]
description = "A diff library for Rust"
readme = "README.md"
-keywords = ["diff", "difference", "patience", "compare", "changes"]
+keywords = [
+ "diff",
+ "difference",
+ "patience",
+ "compare",
+ "changes",
+]
license = "Apache-2.0"
repository = "https://github.com/mitsuhiko/similar"
+
[package.metadata.docs.rs]
all-features = true
+
[profile.release]
debug = true
[[example]]
name = "patience"
-required-features = ["text", "inline"]
+required-features = [
+ "text",
+ "inline",
+]
[[example]]
name = "terminal"
@@ -35,7 +51,11 @@ required-features = ["text"]
[[example]]
name = "terminal-inline"
-required-features = ["text", "inline", "bytes"]
+required-features = [
+ "text",
+ "inline",
+ "bytes",
+]
[[example]]
name = "original-slices"
@@ -43,7 +63,10 @@ required-features = ["text"]
[[example]]
name = "udiff"
-required-features = ["text", "bytes"]
+required-features = [
+ "text",
+ "bytes",
+]
[[example]]
name = "close-matches"
@@ -55,7 +78,11 @@ required-features = ["text"]
[[example]]
name = "serde"
-required-features = ["text", "serde"]
+required-features = [
+ "text",
+ "serde",
+]
+
[dependencies.bstr]
version = "0.2.14"
optional = true
@@ -69,18 +96,26 @@ optional = true
[dependencies.unicode-segmentation]
version = "1.7.1"
optional = true
+
[dev-dependencies.console]
-version = "0.14.0"
+version = "0.15.0"
[dev-dependencies.insta]
-version = "1.6.2"
+version = "1.10.0"
[dev-dependencies.serde_json]
version = "1.0.68"
[features]
-bytes = ["bstr", "text"]
+bytes = [
+ "bstr",
+ "text",
+]
default = ["text"]
inline = ["text"]
text = []
-unicode = ["text", "unicode-segmentation", "bstr/unicode"]
+unicode = [
+ "text",
+ "unicode-segmentation",
+ "bstr/unicode",
+]
diff --git a/vendor/similar/README.md b/vendor/similar/README.md
index 9e033700a..75b6c6c46 100644
--- a/vendor/similar/README.md
+++ b/vendor/similar/README.md
@@ -3,6 +3,7 @@
[![Build Status](https://github.com/mitsuhiko/similar/workflows/Tests/badge.svg?branch=main)](https://github.com/mitsuhiko/similar/actions?query=workflow%3ATests)
[![Crates.io](https://img.shields.io/crates/d/similar.svg)](https://crates.io/crates/similar)
[![License](https://img.shields.io/github/license/mitsuhiko/similar)](https://github.com/mitsuhiko/similar/blob/main/LICENSE)
+[![rustc 1.41.0](https://img.shields.io/badge/rust-1.41%2B-orange.svg)](https://img.shields.io/badge/rust-1.41%2B-orange.svg)
[![Documentation](https://docs.rs/similar/badge.svg)](https://docs.rs/similar)
Similar is a dependency free crate for Rust that implements different diffing
@@ -53,8 +54,7 @@ fn main() {
## License and Links
-- [Documentation](https://docs.rs/similar/)
-- [Issue Tracker](https://github.com/mitsuhiko/similar/issues)
-- [Examples](https://github.com/mitsuhiko/similar/tree/main/examples)
-- License: [Apache-2.0](https://github.com/mitsuhiko/similar/blob/main/LICENSE)
-
+* [Documentation](https://docs.rs/similar/)
+* [Issue Tracker](https://github.com/mitsuhiko/similar/issues)
+* [Examples](https://github.com/mitsuhiko/similar/tree/main/examples)
+* License: [Apache-2.0](https://github.com/mitsuhiko/similar/blob/main/LICENSE)
diff --git a/vendor/similar/src/algorithms/lcs.rs b/vendor/similar/src/algorithms/lcs.rs
index 6d1af687e..5eb3a63d0 100644
--- a/vendor/similar/src/algorithms/lcs.rs
+++ b/vendor/similar/src/algorithms/lcs.rs
@@ -64,6 +64,12 @@ where
let common_prefix_len = common_prefix_len(old, old_range.clone(), new, new_range.clone());
let common_suffix_len = common_suffix_len(old, old_range.clone(), new, new_range.clone());
+ // If the sequences are not different then we're done
+ if common_prefix_len == old_range.len() && (old_range.len() == new_range.len()) {
+ d.equal(0, 0, old_range.len())?;
+ return Ok(());
+ }
+
let maybe_table = make_table(
old,
common_prefix_len..(old_range.len() - common_suffix_len),
@@ -218,3 +224,13 @@ fn test_pat() {
diff(&mut d, a, 0..a.len(), b, 0..b.len()).unwrap();
insta::assert_debug_snapshot!(d.ops());
}
+
+#[test]
+fn test_same() {
+ let a: &[usize] = &[0, 1, 2, 3, 4, 4, 4, 5];
+ let b: &[usize] = &[0, 1, 2, 3, 4, 4, 4, 5];
+
+ let mut d = crate::algorithms::Capture::new();
+ diff(&mut d, a, 0..a.len(), b, 0..b.len()).unwrap();
+ insta::assert_debug_snapshot!(d.ops());
+}
diff --git a/vendor/similar/src/algorithms/myers.rs b/vendor/similar/src/algorithms/myers.rs
index 542c7ed75..8a0c21dbe 100644
--- a/vendor/similar/src/algorithms/myers.rs
+++ b/vendor/similar/src/algorithms/myers.rs
@@ -12,7 +12,7 @@
//! # Heuristics
//!
//! At present this implementation of Myers' does not implement any more advanced
-//! heuristics that would solve some pathological cases. For instane passing two
+//! heuristics that would solve some pathological cases. For instance passing two
//! large and completely distinct sequences to the algorithm will make it spin
//! without making reasonable progress. Currently the only protection in the
//! library against this is to pass a deadline to the diffing algorithm.
diff --git a/vendor/similar/src/algorithms/snapshots/similar__algorithms__lcs__same.snap b/vendor/similar/src/algorithms/snapshots/similar__algorithms__lcs__same.snap
new file mode 100644
index 000000000..4b9511b41
--- /dev/null
+++ b/vendor/similar/src/algorithms/snapshots/similar__algorithms__lcs__same.snap
@@ -0,0 +1,12 @@
+---
+source: src/algorithms/lcs.rs
+assertion_line: 235
+expression: d.ops()
+---
+[
+ Equal {
+ old_index: 0,
+ new_index: 0,
+ len: 8,
+ },
+]
diff --git a/vendor/similar/src/algorithms/utils.rs b/vendor/similar/src/algorithms/utils.rs
index 0d14ac799..812f97ddd 100644
--- a/vendor/similar/src/algorithms/utils.rs
+++ b/vendor/similar/src/algorithms/utils.rs
@@ -11,7 +11,7 @@ pub fn is_empty_range<T: PartialOrd<T>>(range: &Range<T>) -> bool {
!(range.start < range.end)
}
-/// Represents an item in the vector returend by [`unique`].
+/// Represents an item in the vector returned by [`unique`].
///
/// It compares like the underlying item does it was created from but
/// carries the index it was originally created from.
diff --git a/vendor/similar/src/text/mod.rs b/vendor/similar/src/text/mod.rs
index b1a45f3c3..23408e63c 100644
--- a/vendor/similar/src/text/mod.rs
+++ b/vendor/similar/src/text/mod.rs
@@ -37,23 +37,13 @@ impl Deadline {
/// A builder type config for more complex uses of [`TextDiff`].
///
/// Requires the `text` feature.
-#[derive(Clone, Debug)]
+#[derive(Clone, Debug, Default)]
pub struct TextDiffConfig {
algorithm: Algorithm,
newline_terminated: Option<bool>,
deadline: Option<Deadline>,
}
-impl Default for TextDiffConfig {
- fn default() -> TextDiffConfig {
- TextDiffConfig {
- algorithm: Algorithm::default(),
- newline_terminated: None,
- deadline: None,
- }
- }
-}
-
impl TextDiffConfig {
/// Changes the algorithm.
///
@@ -66,7 +56,7 @@ impl TextDiffConfig {
/// Sets a deadline for the diff operation.
///
/// By default a diff will take as long as it takes. For certain diff
- /// algorthms like Myer's and Patience a maximum running time can be
+ /// algorithms like Myer's and Patience a maximum running time can be
/// defined after which the algorithm gives up and approximates.
pub fn deadline(&mut self, deadline: Instant) -> &mut Self {
self.deadline = Some(Deadline::Absolute(deadline));
@@ -768,3 +758,14 @@ fn test_serde_ops() {
let json = serde_json::to_string_pretty(&changes).unwrap();
insta::assert_snapshot!(&json);
}
+
+#[test]
+fn test_regression_issue_37() {
+ let config = TextDiffConfig::default();
+ let diff = config.diff_lines("\u{18}\n\n", "\n\n\r");
+ let mut output = diff.unified_diff();
+ assert_eq!(
+ output.context_radius(0).to_string(),
+ "@@ -1 +1,0 @@\n-\u{18}\n@@ -2,0 +2,2 @@\n+\n+\r"
+ );
+}
diff --git a/vendor/similar/src/udiff.rs b/vendor/similar/src/udiff.rs
index 80a30cf82..1b887e353 100644
--- a/vendor/similar/src/udiff.rs
+++ b/vendor/similar/src/udiff.rs
@@ -57,7 +57,7 @@ impl UnifiedDiffHunkRange {
impl fmt::Display for UnifiedDiffHunkRange {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let mut beginning = self.start() + 1;
- let len = self.end() - self.start();
+ let len = self.end().saturating_sub(self.start());
if len == 1 {
write!(f, "{}", beginning)
} else {
diff --git a/vendor/similar/src/utils.rs b/vendor/similar/src/utils.rs
index 1f8fdc989..44776fe24 100644
--- a/vendor/similar/src/utils.rs
+++ b/vendor/similar/src/utils.rs
@@ -37,7 +37,7 @@ struct SliceRemapper<'x, T: ?Sized> {
indexes: Vec<Range<usize>>,
}
-impl<'x, 'slices, T: DiffableStr + ?Sized> SliceRemapper<'x, T> {
+impl<'x, T: DiffableStr + ?Sized> SliceRemapper<'x, T> {
fn new(source: &'x T, slices: &[&'x T]) -> SliceRemapper<'x, T> {
let indexes = slices
.iter()
@@ -99,7 +99,7 @@ pub struct TextDiffRemapper<'x, T: ?Sized> {
new: SliceRemapper<'x, T>,
}
-impl<'x, 'slices, T: DiffableStr + ?Sized> TextDiffRemapper<'x, T> {
+impl<'x, T: DiffableStr + ?Sized> TextDiffRemapper<'x, T> {
/// Creates a new remapper from strings and slices.
pub fn new(
old_slices: &[&'x T],