From 53b385c69dc090fcc17bf07d18c082bf202b00c4 Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Fri, 23 Feb 2024 10:46:16 +0100 Subject: [PATCH] soapy: args conversion can no longer fail --- src/impls/soapy.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/impls/soapy.rs b/src/impls/soapy.rs index a231925..a812941 100644 --- a/src/impls/soapy.rs +++ b/src/impls/soapy.rs @@ -37,8 +37,8 @@ impl Soapy { let v = soapysdr::enumerate(soapysdr::Args::try_from(args.clone())?)?; let v: Vec = v .into_iter() - .map(Args::try_from) - .collect::, Error>>()?; + .map(Into::into) + .collect(); Ok(v.into_iter() .map(|mut a| { match a.get::("driver") { @@ -409,14 +409,12 @@ impl TryFrom for soapysdr::Args { } } -impl TryFrom for Args { - type Error = Error; - - fn try_from(value: soapysdr::Args) -> Result { +impl From for Args { + fn from(value: soapysdr::Args) -> Self { let mut a = Self::new(); for (key, value) in value.iter() { a.set(key, value); } - Ok(a) + a } }