Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/hover/render.rs')
-rw-r--r--crates/ide/src/hover/render.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/ide/src/hover/render.rs b/crates/ide/src/hover/render.rs
index 5a51752266..45386df2b2 100644
--- a/crates/ide/src/hover/render.rs
+++ b/crates/ide/src/hover/render.rs
@@ -128,7 +128,7 @@ pub(super) fn try_expr(
let l = "Propagated as: ".len() - " Type: ".len();
let static_text_len_diff = l as isize - s.len() as isize;
let tpad = static_text_len_diff.max(0) as usize;
- let ppad = static_text_len_diff.min(0).abs() as usize;
+ let ppad = static_text_len_diff.min(0).unsigned_abs();
res.markup = format!(
"```text\n{} Type: {:>pad0$}\nPropagated as: {:>pad1$}\n```\n",
@@ -342,7 +342,7 @@ pub(super) fn try_for_lint(attr: &ast::Attr, token: &SyntaxToken) -> Option<Hove
tmp = format!("clippy::{}", token.text());
&tmp
} else {
- &*token.text()
+ token.text()
};
let lint =
@@ -507,7 +507,7 @@ fn render_notable_trait_comment(
format_to!(
desc,
"{}",
- assoc_types.into_iter().format_with(", ", |(ty, name), f| {
+ assoc_types.iter().format_with(", ", |(ty, name), f| {
f(&name.display(db))?;
f(&" = ")?;
match ty {
@@ -519,7 +519,7 @@ fn render_notable_trait_comment(
desc.push('>');
}
}
- desc.is_empty().not().then(|| desc)
+ desc.is_empty().not().then_some(desc)
}
fn type_info(
@@ -635,7 +635,7 @@ fn closure_ty(
});
let adjusted = if let Some(adjusted_ty) = adjusted {
- walk_and_push_ty(sema.db, &adjusted_ty, &mut push_new_def);
+ walk_and_push_ty(sema.db, adjusted_ty, &mut push_new_def);
format!(
"\nCoerced to: {}",
adjusted_ty.display(sema.db).with_closure_style(hir::ClosureStyle::ImplFn)