Skip to content

Commit c4302ea

Browse files
committed
unnecessary_lazy_evaluations
1 parent f15ee8a commit c4302ea

File tree

4 files changed

+3
-3
lines changed

4 files changed

+3
-3
lines changed

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ non_canonical_partial_ord_impl = "allow"
181181
self_named_constructors = "allow"
182182
too_many_arguments = "allow"
183183
type_complexity = "allow"
184-
unnecessary_lazy_evaluations = "allow"
185184
unnecessary_mut_passed = "allow"
186185
useless_conversion = "allow"
187186
useless_format = "allow"

crates/hir-def/src/hir/format_args.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ enum PositionUsedAs {
166166
}
167167
use PositionUsedAs::*;
168168

169+
#[allow(clippy::unnecessary_lazy_evaluations)]
169170
pub(crate) fn parse(
170171
s: &ast::String,
171172
fmt_snippet: Option<String>,

crates/hir-expand/src/attrs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ impl Attr {
230230
)
231231
)
232232
})
233-
.unwrap_or_else(|| tt.len());
233+
.unwrap_or(tt.len());
234234

235235
let (path, input) = tt.split_at(path_end);
236236
let path = Interned::new(ModPath::from_tt(db, path)?);

crates/hir/src/attrs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ fn as_module_def_if_namespace_matches(
297297
AssocItem::TypeAlias(it) => (ModuleDef::TypeAlias(it), Namespace::Types),
298298
};
299299

300-
(ns.unwrap_or(expected_ns) == expected_ns).then(|| DocLinkDef::ModuleDef(def))
300+
(ns.unwrap_or(expected_ns) == expected_ns).then_some(DocLinkDef::ModuleDef(def))
301301
}
302302

303303
fn modpath_from_str(link: &str) -> Option<ModPath> {

0 commit comments

Comments
 (0)