Skip to content

Commit

Permalink
soapy: args conversion can no longer fail
Browse files Browse the repository at this point in the history
  • Loading branch information
bastibl committed Feb 23, 2024
1 parent 5a0e57f commit 53b385c
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/impls/soapy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ impl Soapy {
let v = soapysdr::enumerate(soapysdr::Args::try_from(args.clone())?)?;
let v: Vec<Args> = v
.into_iter()
.map(Args::try_from)
.collect::<Result<Vec<Args>, Error>>()?;
.map(Into::into)
.collect();
Ok(v.into_iter()
.map(|mut a| {
match a.get::<String>("driver") {
Expand Down Expand Up @@ -409,14 +409,12 @@ impl TryFrom<Args> for soapysdr::Args {
}
}

impl TryFrom<soapysdr::Args> for Args {
type Error = Error;

fn try_from(value: soapysdr::Args) -> Result<Self, Self::Error> {
impl From<soapysdr::Args> 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
}
}

0 comments on commit 53b385c

Please sign in to comment.