manuel-woelker / rust-vfs

A virtual filesystem for Rust
Apache License 2.0
384 stars 44 forks source link

Graceful Failures for InMemory Solutions #31

Closed jalcine closed 2 years ago

jalcine commented 2 years ago

I ran into a situation where https://github.com/manuel-woelker/rust-vfs/blob/19c1e076ba503376eb06900c936a3e23880bdc28/src/impls/memory.rs#L200 causes my test to panic. It looks like this could be mitigated by calling self.exists() before attempting to pluck the value out or using the Vec::get method to safely get that value out.

(Originally published at: https://jacky.wtf/2022/4/rf/rfC0gc2rn9hwfkifMaPBgeAE)

manuel-woelker commented 2 years ago

Good point, thanks for the report! Should be fixed in 0.7.1

jalcine commented 2 years ago

Thank you!

(Originally published at: https://jacky.wtf/2022/4/Pe/Pe1yAGt6sFF-R7MqYWQJHco-)