unnecessary_lazy_evaluations

This commit is contained in:
Johann Hemmann 2024-01-22 01:19:28 +01:00
parent f15ee8a380
commit c4302eaa56
4 changed files with 3 additions and 3 deletions

View file

@ -181,7 +181,6 @@ non_canonical_partial_ord_impl = "allow"
self_named_constructors = "allow" self_named_constructors = "allow"
too_many_arguments = "allow" too_many_arguments = "allow"
type_complexity = "allow" type_complexity = "allow"
unnecessary_lazy_evaluations = "allow"
unnecessary_mut_passed = "allow" unnecessary_mut_passed = "allow"
useless_conversion = "allow" useless_conversion = "allow"
useless_format = "allow" useless_format = "allow"

View file

@ -166,6 +166,7 @@ enum PositionUsedAs {
} }
use PositionUsedAs::*; use PositionUsedAs::*;
#[allow(clippy::unnecessary_lazy_evaluations)]
pub(crate) fn parse( pub(crate) fn parse(
s: &ast::String, s: &ast::String,
fmt_snippet: Option<String>, fmt_snippet: Option<String>,

View file

@ -230,7 +230,7 @@ impl Attr {
) )
) )
}) })
.unwrap_or_else(|| tt.len()); .unwrap_or(tt.len());
let (path, input) = tt.split_at(path_end); let (path, input) = tt.split_at(path_end);
let path = Interned::new(ModPath::from_tt(db, path)?); let path = Interned::new(ModPath::from_tt(db, path)?);

View file

@ -297,7 +297,7 @@ fn as_module_def_if_namespace_matches(
AssocItem::TypeAlias(it) => (ModuleDef::TypeAlias(it), Namespace::Types), AssocItem::TypeAlias(it) => (ModuleDef::TypeAlias(it), Namespace::Types),
}; };
(ns.unwrap_or(expected_ns) == expected_ns).then(|| DocLinkDef::ModuleDef(def)) (ns.unwrap_or(expected_ns) == expected_ns).then_some(DocLinkDef::ModuleDef(def))
} }
fn modpath_from_str(link: &str) -> Option<ModPath> { fn modpath_from_str(link: &str) -> Option<ModPath> {