Compare commits

..

No commits in common. "f678bcc92919c95fb91765aaa791a92838ae5ed6" and "d63fe663de9dc11a86aa7629e147384357451ab8" have entirely different histories.

View file

@ -36,18 +36,13 @@ where
type Err = Box<dyn std::error::Error + Send + Sync>;
fn from_str(s: &str) -> Result<Self, Self::Err> {
Ok(Self(
s.split("|")
.filter(|v| !v.is_empty())
.map(T::from_str)
.try_fold(
HashSet::new(),
|mut a, b| -> Result<HashSet<T>, Self::Err> {
a.insert(b.map_err(Box::new)?);
Ok(a)
},
)?,
))
Ok(Self(s.split("|").map(T::from_str).try_fold(
HashSet::new(),
|mut a, b| -> Result<HashSet<T>, Self::Err> {
a.insert(b.map_err(Box::new)?);
Ok(a)
},
)?))
}
}
@ -87,9 +82,5 @@ mod test {
panic!("sets arent equivalent");
}
}
let _: StringSet<u32> = StringSet::from_str("").unwrap();
let _: StringSet<u32> = StringSet::from_str("10").unwrap();
}
}