Clippy fixes.
This commit is contained in:
parent
b2479e9de8
commit
e11de60def
@ -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))
|
||||
|
@ -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()));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user