Skip to content

Commit

Permalink
Rework FIXME
Browse files Browse the repository at this point in the history
  • Loading branch information
glyn committed Jun 25, 2024
1 parent c2144c1 commit cb92499
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/jrdmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ pub struct Jrd {
impl Jrd {
// Filter the links to include only those with the specified rel values
pub fn filter(&self, rel: Vec<String>) -> Jrd {
// FIXME: following panics in real use, e.g. with rel= (empty string)
let rel_uris: Vec<Uri> = rel.iter().map(|r| Uri::from_str(&r).unwrap()).collect();
Jrd {
subject: self.subject.clone(),
aliases: self.aliases.clone(),
properties: self.properties.clone(),
links: self.links.clone().map(|lks| {
lks.into_iter().
// FIXME: following panics in real use
filter(|lk| rel_uris.contains(&Uri::from_str(&lk.rel).unwrap())).
collect()
}),
Expand Down

0 comments on commit cb92499

Please sign in to comment.