From ccaf10b4a6f7768294e41fcb6fbcd768a1e1c143 Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Mon, 11 Dec 2023 22:11:01 +0200 Subject: refactor(tvix/*store/sled): make ::new() more generic We don't really require the Path to be a PathBuf, we don't even require it to be a Path, we only need it to be AsRef>. This removes some conversion in the from_addr cases, which can just reuse `url.path()` (a `&str`). Change-Id: I38d536dbaf0b44421e41f211a9ad2b13605179e9 Reviewed-on: https://cl.tvl.fyi/c/depot/+/10258 Autosubmit: flokli Reviewed-by: raitobezarius Tested-by: BuildkiteCI --- tvix/store/src/pathinfoservice/sled.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tvix/store/src/pathinfoservice/sled.rs') diff --git a/tvix/store/src/pathinfoservice/sled.rs b/tvix/store/src/pathinfoservice/sled.rs index 1382c3c29b..ff5ebee476 100644 --- a/tvix/store/src/pathinfoservice/sled.rs +++ b/tvix/store/src/pathinfoservice/sled.rs @@ -3,7 +3,7 @@ use crate::nar::calculate_size_and_sha256; use crate::proto::PathInfo; use futures::{stream::iter, Stream}; use prost::Message; -use std::{path::PathBuf, pin::Pin, sync::Arc}; +use std::{path::Path, pin::Pin, sync::Arc}; use tonic::async_trait; use tracing::warn; use tvix_castore::proto as castorepb; @@ -21,8 +21,8 @@ pub struct SledPathInfoService { } impl SledPathInfoService { - pub fn new( - p: PathBuf, + pub fn new>( + p: P, blob_service: Arc, directory_service: Arc, ) -> Result { -- cgit 1.4.1