Skip to content

Commit b73ee2f

Browse files
committed
useless_conversion
1 parent e7d0dea commit b73ee2f

File tree

7 files changed

+10
-14
lines changed

7 files changed

+10
-14
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-
useless_conversion = "allow"
185184
useless_format = "allow"
186185
wildcard_in_or_patterns = "allow"
187186
wrong_self_convention = "allow"

crates/hir-def/src/body/tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ impl SsrError {
256256
"##,
257257
);
258258

259-
assert_eq!(db.body_with_source_map(def.into()).1.diagnostics(), &[]);
259+
assert_eq!(db.body_with_source_map(def).1.diagnostics(), &[]);
260260
expect![[r#"
261261
fn main() {
262262
_ = $crate::error::SsrError::new(
@@ -309,7 +309,7 @@ fn f() {
309309
"#,
310310
);
311311

312-
let (_, source_map) = db.body_with_source_map(def.into());
312+
let (_, source_map) = db.body_with_source_map(def);
313313
assert_eq!(source_map.diagnostics(), &[]);
314314

315315
for (_, def_map) in body.blocks(&db) {

crates/hir-def/src/data.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ impl<'a> AssocItemCollector<'a> {
782782
self.diagnostics.push(DefDiagnostic::macro_expansion_parse_error(
783783
self.module_id.local_id,
784784
error_call_kind(),
785-
errors.into(),
785+
errors,
786786
));
787787
}
788788

crates/hir-def/src/nameres/path_resolution.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ impl DefMap {
475475
let macro_use_prelude = || {
476476
self.macro_use_prelude.get(name).map_or(PerNs::none(), |&(it, _extern_crate)| {
477477
PerNs::macros(
478-
it.into(),
478+
it,
479479
Visibility::Public,
480480
// FIXME?
481481
None, // extern_crate.map(ImportOrExternCrate::ExternCrate),

crates/hir-def/src/per_ns.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,11 @@ impl PerNs {
131131
.into_iter()
132132
.chain(
133133
self.values
134-
.map(|it| (ItemInNs::Values(it.0), it.2.map(ImportOrExternCrate::Import)))
135-
.into_iter(),
134+
.map(|it| (ItemInNs::Values(it.0), it.2.map(ImportOrExternCrate::Import))),
136135
)
137136
.chain(
138137
self.macros
139-
.map(|it| (ItemInNs::Macros(it.0), it.2.map(ImportOrExternCrate::Import)))
140-
.into_iter(),
138+
.map(|it| (ItemInNs::Macros(it.0), it.2.map(ImportOrExternCrate::Import))),
141139
)
142140
}
143141
}

crates/hir/src/attrs.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,9 @@ fn resolve_impl_trait_item(
239239
) -> Option<DocLinkDef> {
240240
let canonical = ty.canonical();
241241
let krate = ty.krate(db);
242-
let environment = resolver.generic_def().map_or_else(
243-
|| crate::TraitEnvironment::empty(krate.id).into(),
244-
|d| db.trait_environment(d),
245-
);
242+
let environment = resolver
243+
.generic_def()
244+
.map_or_else(|| crate::TraitEnvironment::empty(krate.id), |d| db.trait_environment(d));
246245
let traits_in_scope = resolver.traits_in_scope(db.upcast());
247246

248247
let mut result = None;

crates/rust-analyzer/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1744,7 +1744,7 @@ impl Config {
17441744
}
17451745

17461746
pub fn main_loop_num_threads(&self) -> usize {
1747-
self.data.numThreads.unwrap_or(num_cpus::get_physical().try_into().unwrap_or(1))
1747+
self.data.numThreads.unwrap_or(num_cpus::get_physical())
17481748
}
17491749

17501750
pub fn typing_autoclose_angle(&self) -> bool {

0 commit comments

Comments
 (0)