From eb22e800a1c6b0e505c64e1b5db35aab0916f80b Mon Sep 17 00:00:00 2001 From: bad Date: Fri, 19 Aug 2022 22:53:28 +0200 Subject: [PATCH] Don't expose private sig parse method via try_from --- src/narinfo/from_str.rs | 2 +- src/sig.rs | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/narinfo/from_str.rs b/src/narinfo/from_str.rs index b1932ab..8ea794a 100644 --- a/src/narinfo/from_str.rs +++ b/src/narinfo/from_str.rs @@ -49,7 +49,7 @@ impl<'a> NarInfo<'a> { "System" => builder.system(Some(Cow::from(value))), "References" => builder.references(value.split(' ').map(Cow::from).collect()), "Sig" => { - sigs.push(Sig::try_from(value)?); + sigs.push(Sig::parse(value)?); &mut builder }, _ => return Err(ParsingError::UnknownKey { key }), diff --git a/src/sig.rs b/src/sig.rs index 8e9f992..4b6e4fe 100644 --- a/src/sig.rs +++ b/src/sig.rs @@ -12,13 +12,6 @@ pub struct Sig<'a> { pub sig: Cow<'a, str>, } -impl<'a> TryFrom<&'a str> for Sig<'a> { - type Error = ParsingError<'a>; - - fn try_from(value: &'a str) -> ParsingResult { - Sig::parse(value) - } -} // Neither the parse nor the serializa method is public since // it doesn't really make sense to de/serialize the // sig into the narinfo format outside of de/serializing a whole narinfo