diff options
author | Ryan Lahfa <tvl@lahfa.xyz> | 2024-01-08T08·45+0100 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2024-01-18T14·40+0000 |
commit | 93afc711f65784ed258834613937ca5177201a82 (patch) | |
tree | df29359da0a68cd8cc9b83b49de93fb04151f7bf /tvix/castore/src/import.rs | |
parent | 501827db59eb9e67ef9c637483efa5a0e5d09c06 (diff) |
feat(tvix/castore): convert import error to `std::io::Error` r/7412
So that we can just `map_err` easily in functions returning `std::io::Error` but calling functions returning `castore::import::Error`. Change-Id: Id181b95e8431c69e95f3a8cd569ca10306656e1d Reviewed-on: https://cl.tvl.fyi/c/depot/+/10572 Autosubmit: raitobezarius <tvl@lahfa.xyz> Reviewed-by: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/castore/src/import.rs')
-rw-r--r-- | tvix/castore/src/import.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tvix/castore/src/import.rs b/tvix/castore/src/import.rs index cf4b42fb6826..b0d2786e0412 100644 --- a/tvix/castore/src/import.rs +++ b/tvix/castore/src/import.rs @@ -44,6 +44,12 @@ impl From<CastoreError> for Error { } } +impl From<Error> for std::io::Error { + fn from(value: Error) -> Self { + std::io::Error::new(std::io::ErrorKind::Other, value) + } +} + /// This processes a given [walkdir::DirEntry] and returns a /// proto::node::Node, depending on the type of the entry. /// |