Unnamed repository; edit this file 'description' to name the repository.
-rw-r--r--Cargo.toml1
-rw-r--r--crates/hir/src/lib.rs6
2 files changed, 3 insertions, 4 deletions
diff --git a/Cargo.toml b/Cargo.toml
index e4ad41b6e6..b9b3d3d8f4 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -176,7 +176,6 @@ forget_non_drop = "allow"
format_collect = "allow"
large_enum_variant = "allow"
needless_doctest_main = "allow"
-needless_return = "allow"
new_without_default = "allow"
nonminimal_bool = "allow"
non_canonical_clone_impl = "allow"
diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs
index 3adeef6c18..3ec60ca69e 100644
--- a/crates/hir/src/lib.rs
+++ b/crates/hir/src/lib.rs
@@ -2404,10 +2404,10 @@ impl Const {
}
}
if let Ok(s) = mir::render_const_using_debug_impl(db, self.id, &c) {
- return Ok(s);
+ Ok(s)
+ } else {
+ Ok(format!("{}", c.display(db)))
}
- let r = format!("{}", c.display(db));
- return Ok(r);
}
}