diff options
| author | Marek Barvíř <barvirm@gmail.com> | 2023-03-28 09:38:01 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-28 09:38:01 +0200 |
| commit | 213f31c5d71b3a5676ec8cce58204b1ac7f2cdea (patch) | |
| tree | bb0730bbc768f80eb3995b3a55d12a0f62ab3ee8 /src/ide | |
| parent | dfbd3503d9a03215238ade30726651b09d6fab2d (diff) | |
Fix basic lints (cargo clippy) (#383)
Diffstat (limited to 'src/ide')
| -rw-r--r-- | src/ide/complete.rs | 12 | ||||
| -rw-r--r-- | src/ide/tooltip.rs | 2 |
2 files changed, 6 insertions, 8 deletions
diff --git a/src/ide/complete.rs b/src/ide/complete.rs index 4dacc2b2..27b199fd 100644 --- a/src/ide/complete.rs +++ b/src/ide/complete.rs @@ -122,7 +122,7 @@ fn complete_markup(ctx: &mut CompletionContext) -> bool { } // Directly after a raw block. - let mut s = Scanner::new(&ctx.text); + let mut s = Scanner::new(ctx.text); s.jump(ctx.leaf.offset()); if s.eat_if("```") { s.eat_while('`'); @@ -651,7 +651,7 @@ fn param_completions( kind: CompletionKind::Param, label: param.name.into(), apply: Some(eco_format!("{}: ${{}}", param.name)), - detail: Some(plain_docs_sentence(param.docs).into()), + detail: Some(plain_docs_sentence(param.docs)), }); } @@ -896,8 +896,8 @@ impl<'a> CompletionContext<'a> { frames, library, source, - global: &library.global.scope(), - math: &library.math.scope(), + global: library.global.scope(), + math: library.math.scope(), text, before: &text[..cursor], after: &text[cursor..], @@ -1002,9 +1002,7 @@ impl<'a> CompletionContext<'a> { let detail = docs.map(Into::into).or_else(|| match value { Value::Symbol(_) => None, - Value::Func(func) => { - func.info().map(|info| plain_docs_sentence(info.docs).into()) - } + Value::Func(func) => func.info().map(|info| plain_docs_sentence(info.docs)), v => Some(v.repr().into()), }); diff --git a/src/ide/tooltip.rs b/src/ide/tooltip.rs index b17a1acc..35125e92 100644 --- a/src/ide/tooltip.rs +++ b/src/ide/tooltip.rs @@ -126,7 +126,7 @@ fn ref_tooltip( let target = leaf.text().trim_start_matches('@'); for (label, detail) in analyze_labels(world, frames).0 { if label.0 == target { - return Some(Tooltip::Text(detail?.into())); + return Some(Tooltip::Text(detail?)); } } |
