-
Notifications
You must be signed in to change notification settings - Fork 55
Open
Description
This may come down to a philosophical difference: I don't think library code should panic and bring down the application when you call it with the wrong inputs, so I tend to avoid unwrap() (with unwrap_used = "deny") unless I've checked some invariants.
Location.convert does this:
pub fn convert<ToSpace>(&self, axes: &Axes) -> Location<ToSpace>
where
Space: ConvertSpace<ToSpace>,
{
self.0
.iter()
.map(|(tag, coord)| (*tag, coord.convert(&axes.get(tag).unwrap().converter)))
.collect()
}
}
If the tag in the location is not present in the axes, I believe it should be skipped, or an Err raised, but the program should not explode.
Metadata
Metadata
Assignees
Labels
No labels