From 8728d02c70202594858fc5e9fec308c107917203 Mon Sep 17 00:00:00 2001 From: Fintan Halpenny Date: Fri, 9 Feb 2024 10:21:31 +0000 Subject: [PATCH] cob: move unwrap_used pragma Clippy does not recognise this `allow` pragma to be used at the `unwrap` call site. Instead, if it's moved up to the match case it will be recognised. Signed-off-by: Fintan Halpenny X-Clacks-Overhead: GNU Terry Pratchett --- radicle-cob/src/trailers.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/radicle-cob/src/trailers.rs b/radicle-cob/src/trailers.rs index dc7ef317..2403a8b5 100644 --- a/radicle-cob/src/trailers.rs +++ b/radicle-cob/src/trailers.rs @@ -61,18 +61,18 @@ impl TryFrom<&OwnedTrailer> for CommitTrailer { impl From for Trailer<'_> { fn from(t: CommitTrailer) -> Self { match t { + #[allow(clippy::unwrap_used)] CommitTrailer::Related(oid) => { Trailer { // SAFETY: "Rad-Related" is a valid `Token`. - #[allow(clippy::unwrap_used)] token: Token::try_from("Rad-Related").unwrap(), value: oid.to_string().into(), } } + #[allow(clippy::unwrap_used)] CommitTrailer::Resource(oid) => { Trailer { // SAFETY: "Rad-Resource" is a valid `Token`. - #[allow(clippy::unwrap_used)] token: Token::try_from("Rad-Resource").unwrap(), value: oid.to_string().into(), }