Make clippy happy

This commit is contained in:
Clément Renault 2023-01-17 18:01:26 +01:00
parent 2b1f6a7f11
commit 1b78231e18
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
19 changed files with 115 additions and 139 deletions

View file

@ -398,7 +398,7 @@ pub mod tests {
/// Create a raw [Token]. You must specify the string that appear BEFORE your element followed by your element
pub fn rtok<'a>(before: &'a str, value: &'a str) -> Token<'a> {
// if the string is empty we still need to return 1 for the line number
let lines = before.is_empty().then(|| 1).unwrap_or_else(|| before.lines().count());
let lines = before.is_empty().then_some(1).unwrap_or_else(|| before.lines().count());
let offset = before.chars().count();
// the extra field is not checked in the tests so we can set it to nothing
unsafe { Span::new_from_raw_offset(offset, lines as u32, value, "") }.into()