From 52adf9ec4c8ac52aa484ac89845636df7b6cb174 Mon Sep 17 00:00:00 2001 From: Jacob Date: Thu, 7 May 2026 01:41:51 -0400 Subject: [PATCH] chore: `Arc` the `uri` internal to and rarely used by `Storage` so that cloning it is cheaper --- src/storage.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/storage.rs b/src/storage.rs index 8d42b86..b434d25 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -1,10 +1,10 @@ -use std::{fmt::Debug, str::FromStr}; +use std::{fmt::Debug, str::FromStr, sync::Arc}; use opendal::{IntoOperatorUri, Operator, OperatorUri}; #[derive(Clone)] pub struct Storage { - uri: OperatorUri, + uri: Arc, operator: Operator, } @@ -14,6 +14,8 @@ impl FromStr for Storage { fn from_str(s: &str) -> Result { let uri = s.into_operator_uri()?; let operator = Operator::from_uri(&uri)?; + + let uri = uri.into(); Ok(Self { uri, operator }) }