From 93afc711f65784ed258834613937ca5177201a82 Mon Sep 17 00:00:00 2001 From: Ryan Lahfa Date: Mon, 8 Jan 2024 09:45:55 +0100 Subject: [PATCH] feat(tvix/castore): convert import error to `std::io::Error` 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 Reviewed-by: flokli Tested-by: BuildkiteCI --- tvix/castore/src/import.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tvix/castore/src/import.rs b/tvix/castore/src/import.rs index cf4b42fb6..b0d2786e0 100644 --- a/tvix/castore/src/import.rs +++ b/tvix/castore/src/import.rs @@ -44,6 +44,12 @@ impl From for Error { } } +impl From 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. ///