From 9757bf637791b8c2169225990682e5d42141e97d Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Thu, 12 Oct 2023 19:26:52 +0200 Subject: refactor(tvix/*store): helper for channel creation from url This moves the repetitive code to parse a URL and create a channel connected to it into `tvix_castore::channel::from_url`. Part of b/308 Change-Id: Idd342cd71cad5e78a9b258b38c1b227993e75310 Reviewed-on: https://cl.tvl.fyi/c/depot/+/9707 Tested-by: BuildkiteCI Reviewed-by: Connor Brewster --- tvix/castore/src/errors.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tvix/castore/src/errors.rs') diff --git a/tvix/castore/src/errors.rs b/tvix/castore/src/errors.rs index 3b23f972b045..9f596afd4e26 100644 --- a/tvix/castore/src/errors.rs +++ b/tvix/castore/src/errors.rs @@ -34,6 +34,12 @@ impl From for Status { } } +impl From for Error { + fn from(value: crate::channel::Error) -> Self { + Self::StorageError(value.to_string()) + } +} + // TODO: this should probably go somewhere else? impl From for std::io::Error { fn from(value: Error) -> Self { -- cgit 1.4.1