From 835d7e9b9495840c89c74e29bcf7f9ea01a11138 Mon Sep 17 00:00:00 2001 From: max <36980911+pr2502@users.noreply.github.com> Date: Mon, 11 Mar 2024 21:03:41 +0100 Subject: [PATCH] clippy --- src/lsp/ext.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lsp/ext.rs b/src/lsp/ext.rs index 54aadce..3342575 100644 --- a/src/lsp/ext.rs +++ b/src/lsp/ext.rs @@ -23,8 +23,8 @@ impl RequestId { pub fn tag(&self, tag: Tag) -> RequestId { let tag = match tag { Tag::Port(port) => format!("port:{port}"), - Tag::Drop => format!("drop"), - Tag::Forward => format!("forward"), + Tag::Drop => "drop".into(), + Tag::Forward => "forward".into(), }; let id = match self { RequestId::Number(number) => format!("n:{number}"), @@ -56,25 +56,25 @@ impl RequestId { }; if let Some(rest) = input.strip_prefix("port:") { - let (port, rest) = parse_port(&rest)?; - let inner_id = parse_inner_id(&rest).context("failed to parse inner ID")?; + let (port, rest) = parse_port(rest)?; + let inner_id = parse_inner_id(rest).context("failed to parse inner ID")?; return Ok((Tag::Port(port), inner_id)); } if let Some(rest) = input.strip_prefix("drop:") { - let inner_id = parse_inner_id(&rest).context("failed to parse inner ID")?; + let inner_id = parse_inner_id(rest).context("failed to parse inner ID")?; return Ok((Tag::Drop, inner_id)); } if let Some(rest) = input.strip_prefix("forward:") { - let inner_id = parse_inner_id(&rest).context("failed to parse inner ID")?; + let inner_id = parse_inner_id(rest).context("failed to parse inner ID")?; return Ok((Tag::Forward, inner_id)); } bail!("unrecognized prefix: {input:?}"); } - match parse_tag(&self) { + match parse_tag(self) { Ok((tag, inner_id)) => (Some(tag), inner_id), Err(err) => { warn!(?err, "invalid tagged ID");