chore: Arc the uri internal to and rarely used by Storage so that cloning it is cheaper

This commit is contained in:
2026-05-07 01:41:51 -04:00
parent cfa81784b7
commit 52adf9ec4c

View File

@@ -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<OperatorUri>,
operator: Operator,
}
@@ -15,6 +15,8 @@ impl FromStr for Storage {
let uri = s.into_operator_uri()?;
let operator = Operator::from_uri(&uri)?;
let uri = uri.into();
Ok(Self { uri, operator })
}
}