Open Ciel-MC opened 10 months ago
Using dyn increments runtime cost. Since we can predefine possible errors, no other error possibly returned by this procedure, it don’t need to use dyn as far as I think, maybe adding ‘InvalidFile’ error to enum is enough? Also, dyn error::Error makes error type less expressive.
Anyways, rust is not my primary language, possibly Im wrong, though
Hi, I liked your video and wanted to check the Rust impl out, and I felt that it could be made better. Here's what I came up with, this uses
thiserror
for a proper error type, but aBox<dyn Error>
should work fine as well.I also notice that methods that already return R<T, B> doesn't catch IO errors, like
Could just be