mirror of
https://github.com/crate-ci/typos.git
synced 2024-12-25 00:52:08 -05:00
refactor: Resolve deprecations
This commit is contained in:
parent
b5345d6242
commit
6f2c324a4d
15 changed files with 17 additions and 21 deletions
5
Cargo.lock
generated
5
Cargo.lock
generated
|
@ -1153,14 +1153,9 @@ checksum = "f37d101fcafc8e73748fd8a1b7048f5979f93d372fd17027d7724c1643bc379b"
|
|||
dependencies = [
|
||||
"anstream",
|
||||
"anstyle",
|
||||
"content_inspector",
|
||||
"dunce",
|
||||
"filetime",
|
||||
"normalize-line-endings",
|
||||
"similar",
|
||||
"snapbox-macros",
|
||||
"tempfile",
|
||||
"walkdir",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
|
@ -25,7 +25,7 @@ unicase = "2.7"
|
|||
itertools = "0.12"
|
||||
codegenrs = "3.0"
|
||||
dictgen = { version = "^0.2", path = "../dictgen", features = ["codegen"] }
|
||||
snapbox = { version = "0.5.14", features = ["path"] }
|
||||
snapbox = "0.5.14"
|
||||
typos = { path = "../typos" }
|
||||
|
||||
[lints]
|
||||
|
|
|
@ -7,7 +7,7 @@ fn codegen() {
|
|||
|
||||
let content = String::from_utf8(content).unwrap();
|
||||
let content = codegenrs::rustfmt(&content, None).unwrap();
|
||||
snapbox::assert_eq(snapbox::file!["../src/dict_codegen.rs"], content);
|
||||
snapbox::assert_data_eq!(content, snapbox::file!["../src/dict_codegen.rs"].raw());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -31,7 +31,7 @@ fn compat() {
|
|||
writeln!(content).unwrap();
|
||||
}
|
||||
|
||||
snapbox::assert_eq(snapbox::file!["../assets/compatible.csv"], &content);
|
||||
snapbox::assert_data_eq!(content, snapbox::file!["../assets/compatible.csv"].raw());
|
||||
}
|
||||
|
||||
fn is_word(word: &str) -> bool {
|
||||
|
|
|
@ -24,7 +24,7 @@ itertools = "0.12"
|
|||
codegenrs = "3.0"
|
||||
regex = "1"
|
||||
dictgen = { version = "^0.2", path = "../dictgen", features = ["codegen"] }
|
||||
snapbox = { version = "0.5.14", features = ["path"] }
|
||||
snapbox = "0.5.14"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
|
|
@ -9,7 +9,7 @@ fn codegen() {
|
|||
|
||||
let content = String::from_utf8(content).unwrap();
|
||||
let content = codegenrs::rustfmt(&content, None).unwrap();
|
||||
snapbox::assert_eq(snapbox::file!["../src/dict_codegen.rs"], content);
|
||||
snapbox::assert_data_eq!(content, snapbox::file!["../src/dict_codegen.rs"].raw());
|
||||
}
|
||||
|
||||
fn generate<W: std::io::Write>(file: &mut W) {
|
||||
|
|
|
@ -88,6 +88,7 @@ pub(crate) struct StaticDictConfig {
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use itertools::Itertools;
|
||||
use snapbox::prelude::*;
|
||||
|
||||
use super::TYPE_SPECIFIC_DICTS;
|
||||
|
||||
|
@ -96,7 +97,7 @@ mod tests {
|
|||
let types: Vec<_> = TYPE_SPECIFIC_DICTS.iter().map(|(typ, _)| *typ).collect();
|
||||
let types_unique: Vec<_> = types.clone().into_iter().unique().collect();
|
||||
|
||||
snapbox::assert_eq(types.join("\n"), types_unique.join("\n"));
|
||||
snapbox::assert_data_eq!(types_unique.join("\n"), types.join("\n").raw());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -108,6 +109,6 @@ mod tests {
|
|||
let types: Vec<_> = TYPE_SPECIFIC_DICTS.iter().map(|(typ, _)| *typ).collect();
|
||||
let types_sorted: Vec<_> = types.iter().cloned().sorted().collect();
|
||||
|
||||
snapbox::assert_eq(types.join("\n"), types_sorted.join("\n"));
|
||||
snapbox::assert_data_eq!(types_sorted.join("\n"), types.join("\n").raw());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ unicase = "2.7"
|
|||
codegenrs = "3.0"
|
||||
dictgen = { version = "^0.2", path = "../dictgen", features = ["codegen"] }
|
||||
varcon = { version = "^0.7", path = "../varcon" }
|
||||
snapbox = { version = "0.5.14", features = ["path"] }
|
||||
snapbox = "0.5.14"
|
||||
indexmap = "2.2.6"
|
||||
|
||||
[lints]
|
||||
|
|
|
@ -6,7 +6,7 @@ fn codegen() {
|
|||
|
||||
let content = String::from_utf8(content).unwrap();
|
||||
let content = codegenrs::rustfmt(&content, None).unwrap();
|
||||
snapbox::assert_eq(snapbox::file!["../src/word_codegen.rs"], content);
|
||||
snapbox::assert_data_eq!(content, snapbox::file!["../src/word_codegen.rs"].raw());
|
||||
}
|
||||
|
||||
fn generate<W: std::io::Write>(file: &mut W, prefix: &str, dict: &[u8]) {
|
||||
|
|
|
@ -25,7 +25,7 @@ fn verify() {
|
|||
drop(wtr);
|
||||
|
||||
let content = String::from_utf8(content).unwrap();
|
||||
snapbox::assert_eq(snapbox::file!["../assets/words.csv"], content);
|
||||
snapbox::assert_data_eq!(content, snapbox::file!["../assets/words.csv"].raw());
|
||||
}
|
||||
|
||||
fn parse_dict(path: &str) -> Vec<(String, Vec<String>)> {
|
||||
|
|
|
@ -28,7 +28,7 @@ unicase = "2.7"
|
|||
codegenrs = "3.0"
|
||||
itertools = "0.12"
|
||||
dictgen = { version = "^0.2", path = "../dictgen", features = ["codegen"] }
|
||||
snapbox = { version = "0.5.14", features = ["path"] }
|
||||
snapbox = "0.5.14"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
|
|
@ -9,7 +9,7 @@ fn codegen() {
|
|||
|
||||
let content = String::from_utf8(content).unwrap();
|
||||
let content = codegenrs::rustfmt(&content, None).unwrap();
|
||||
snapbox::assert_eq(snapbox::file!["../src/vars_codegen.rs"], content);
|
||||
snapbox::assert_data_eq!(content, snapbox::file!["../src/vars_codegen.rs"].raw());
|
||||
}
|
||||
|
||||
static CATEGORIES: [varcon::Category; 4] = [
|
||||
|
|
|
@ -26,7 +26,7 @@ varcon-core = { version = "^4.0", path = "../varcon-core" }
|
|||
[dev-dependencies]
|
||||
codegenrs = "3.0"
|
||||
varcon-core = { version = "^4.0", path = "../varcon-core", features = ["parser"] }
|
||||
snapbox = { version = "0.5.14", features = ["path"] }
|
||||
snapbox = "0.5.14"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
|
|
@ -9,7 +9,7 @@ fn codegen() {
|
|||
|
||||
let content = String::from_utf8(content).unwrap();
|
||||
let content = codegenrs::rustfmt(&content, None).unwrap();
|
||||
snapbox::assert_eq(snapbox::file!["../src/codegen.rs"], content);
|
||||
snapbox::assert_data_eq!(content, snapbox::file!["../src/codegen.rs"].raw());
|
||||
}
|
||||
|
||||
fn generate<W: std::io::Write>(file: &mut W) {
|
||||
|
|
|
@ -24,7 +24,7 @@ unicase = "2.7"
|
|||
itertools = "0.12"
|
||||
codegenrs = "3.0"
|
||||
dictgen = { version = "^0.2", path = "../dictgen", features = ["codegen"] }
|
||||
snapbox = { version = "0.5.14", features = ["path"] }
|
||||
snapbox = "0.5.14"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
|
|
@ -7,7 +7,7 @@ fn codegen() {
|
|||
|
||||
let content = String::from_utf8(content).unwrap();
|
||||
let content = codegenrs::rustfmt(&content, None).unwrap();
|
||||
snapbox::assert_eq(snapbox::file!["../src/dict_codegen.rs"], content);
|
||||
snapbox::assert_data_eq!(content, snapbox::file!["../src/dict_codegen.rs"].raw());
|
||||
}
|
||||
|
||||
fn generate<W: std::io::Write>(file: &mut W) {
|
||||
|
|
Loading…
Reference in a new issue