Fix clippy lints on all targets (#481)

This commit is contained in:
xtqqczze 2026-05-07 14:07:27 +01:00 committed by GitHub
commit d0108b23e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 6 additions and 5 deletions

View file

@ -56,7 +56,7 @@ jobs:
toolchain: stable toolchain: stable
components: clippy components: clippy
- name: run clippy lints - name: run clippy lints
run: cargo clippy --features logging run: cargo clippy --all-targets --features logging
fmt: fmt:
name: run rustfmt name: run rustfmt

View file

@ -439,7 +439,7 @@ mod tests {
#[test] #[test]
fn placeholder_inside_escaped() { fn placeholder_inside_escaped() {
assert_eq!( assert_eq!(
run("test", r#"test \{\{{{var}} normal\}\}"#), run("test", r"test \{\{{{var}} normal\}\}"),
[ [
CommandName("test"), CommandName("test"),
NormalCode(" {{"), NormalCode(" {{"),
@ -450,10 +450,10 @@ mod tests {
} }
#[test] #[test]
/// Regression test for https://github.com/tealdeer-rs/tealdeer/issues/473 /// Regression test for <https://github.com/tealdeer-rs/tealdeer/issues/473>
fn prefix_check_character_boundary() { fn prefix_check_character_boundary() {
assert_eq!("Ä".len(), 2); assert_eq!("Ä".len(), 2);
assert_eq!(run("", r#"Äxx{{x}}"#), [NormalCode("Äxx"), Variable("x")],); assert_eq!(run("", r"Äxx{{x}}"), [NormalCode("Äxx"), Variable("x")],);
} }
} }
} }

View file

@ -555,7 +555,7 @@ fn test_cache_location_permission_denied() {
// Make cache directory unreadable // Make cache directory unreadable
let cache_dir = testenv.cache_dir(); let cache_dir = testenv.cache_dir();
let mut permissions = cache_dir.metadata().unwrap().permissions(); let mut permissions = cache_dir.metadata().unwrap().permissions();
permissions.set_mode(0); permissions.set_mode(0o0);
fs::set_permissions(cache_dir, permissions).unwrap(); fs::set_permissions(cache_dir, permissions).unwrap();
testenv testenv
@ -1047,6 +1047,7 @@ fn test_search_language_precedence() {
testenv.add_lang_entry(lang, lang, ""); testenv.add_lang_entry(lang, lang, "");
} }
#[expect(clippy::type_complexity)]
let run = |cases: &[(Vec<(&str, &str)>, Vec<&str>, &str)]| { let run = |cases: &[(Vec<(&str, &str)>, Vec<&str>, &str)]| {
for (extra_env, extra_args, expected) in cases { for (extra_env, extra_args, expected) in cases {
let mut cmd = testenv.command(); let mut cmd = testenv.command();