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 <fintan.halpenny@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett
This commit is contained in:
parent
17744a03fd
commit
8728d02c70
|
|
@ -61,18 +61,18 @@ impl TryFrom<&OwnedTrailer> for CommitTrailer {
|
||||||
impl From<CommitTrailer> for Trailer<'_> {
|
impl From<CommitTrailer> for Trailer<'_> {
|
||||||
fn from(t: CommitTrailer) -> Self {
|
fn from(t: CommitTrailer) -> Self {
|
||||||
match t {
|
match t {
|
||||||
|
#[allow(clippy::unwrap_used)]
|
||||||
CommitTrailer::Related(oid) => {
|
CommitTrailer::Related(oid) => {
|
||||||
Trailer {
|
Trailer {
|
||||||
// SAFETY: "Rad-Related" is a valid `Token`.
|
// SAFETY: "Rad-Related" is a valid `Token`.
|
||||||
#[allow(clippy::unwrap_used)]
|
|
||||||
token: Token::try_from("Rad-Related").unwrap(),
|
token: Token::try_from("Rad-Related").unwrap(),
|
||||||
value: oid.to_string().into(),
|
value: oid.to_string().into(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#[allow(clippy::unwrap_used)]
|
||||||
CommitTrailer::Resource(oid) => {
|
CommitTrailer::Resource(oid) => {
|
||||||
Trailer {
|
Trailer {
|
||||||
// SAFETY: "Rad-Resource" is a valid `Token`.
|
// SAFETY: "Rad-Resource" is a valid `Token`.
|
||||||
#[allow(clippy::unwrap_used)]
|
|
||||||
token: Token::try_from("Rad-Resource").unwrap(),
|
token: Token::try_from("Rad-Resource").unwrap(),
|
||||||
value: oid.to_string().into(),
|
value: oid.to_string().into(),
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue