From e11de60def77997849d51c734ada389244ca0017 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Wed, 18 Oct 2023 18:39:04 -0400 Subject: [PATCH] Clippy fixes. --- src/parser/affiliated_keyword.rs | 4 ++-- src/parser/keyword.rs | 9 +-------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/parser/affiliated_keyword.rs b/src/parser/affiliated_keyword.rs index b9774a9f..346c9086 100644 --- a/src/parser/affiliated_keyword.rs +++ b/src/parser/affiliated_keyword.rs @@ -149,7 +149,7 @@ where AffiliatedKeywords { keywords: ret } } -fn translate_name<'g, 's>(name: &'s str) -> String { +fn translate_name(name: &str) -> String { let name_until_optval = name .split_once('[') .map(|(before, _after)| before) @@ -169,7 +169,7 @@ enum AffiliatedKeywordType { ObjectTree, } -fn identify_keyword_type<'g, 's>(name: &'s str) -> AffiliatedKeywordType { +fn identify_keyword_type(name: &str) -> AffiliatedKeywordType { let is_multiple = ["CAPTION", "HEADER"] .into_iter() .any(|candidate| name.eq_ignore_ascii_case(candidate)) diff --git a/src/parser/keyword.rs b/src/parser/keyword.rs index f6cca6c4..32db3613 100644 --- a/src/parser/keyword.rs +++ b/src/parser/keyword.rs @@ -221,19 +221,12 @@ mod tests { use test::Bencher; use super::*; - use crate::context::Context; - use crate::context::ContextElement; - use crate::context::GlobalSettings; - use crate::context::List; use crate::parser::OrgSource; #[bench] fn bench_affiliated_keyword(b: &mut Bencher) { let input = OrgSource::new("#+CAPTION[*foo*]: bar *baz*"); - let global_settings = GlobalSettings::default(); - let initial_context = ContextElement::document_context(); - let initial_context = Context::new(&global_settings, List::new(&initial_context)); - b.iter(|| assert!(affiliated_keyword(&initial_context, input).is_ok())); + b.iter(|| assert!(affiliated_keyword(input).is_ok())); } }