Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion obstore/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ fn main() {
let lockfile_location = get_lockfile_location().unwrap();
let (version, source) = read_lockfile(&lockfile_location);

println!("cargo:rustc-env=OBJECT_STORE_VERSION={}", version);
println!("cargo:rustc-env=OBJECT_STORE_VERSION={version}");
println!(
"cargo:rustc-env=OBJECT_STORE_SOURCE={}",
source.map(|s| s.to_string()).unwrap_or("".to_string())
Expand Down
2 changes: 1 addition & 1 deletion obstore/src/attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fn attribute_to_string(attribute: &Attribute) -> Cow<'static, str> {
Attribute::ContentType => Cow::Borrowed("Content-Type"),
Attribute::CacheControl => Cow::Borrowed("Cache-Control"),
Attribute::Metadata(x) => x.clone(),
other => panic!("Unexpected attribute: {:?}", other),
other => panic!("Unexpected attribute: {other:?}"),
}
}

Expand Down
3 changes: 1 addition & 2 deletions obstore/src/buffered.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,7 @@ impl PyReadableFile {
2 => SeekFrom::End(offset as _),
other => {
return Err(PyIOError::new_err(format!(
"Invalid value for whence in seek: {}",
other
"Invalid value for whence in seek: {other}"
)))
}
};
Expand Down
2 changes: 1 addition & 1 deletion obstore/src/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ pub(crate) fn list(
"\nInstall with `pip install arro3-core`."
);
py.import(intern!(py, "arro3.core"))
.map_err(|err| PyImportError::new_err(format!("{}\n\n{}", msg, err)))?;
.map_err(|err| PyImportError::new_err(format!("{msg}\n\n{err}")))?;
}

let store = store.into_inner().clone();
Expand Down
3 changes: 1 addition & 2 deletions obstore/src/put.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ impl<'py> FromPyObject<'py> for PyPutMode {
"create" => Ok(Self(PutMode::Create)),
"overwrite" => Ok(Self(PutMode::Overwrite)),
_ => Err(PyValueError::new_err(format!(
"Unexpected input for PutMode: {}",
s
"Unexpected input for PutMode: {s}"
))),
}
} else {
Expand Down
3 changes: 1 addition & 2 deletions obstore/src/signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ impl<'py> FromPyObject<'py> for PyMethod {
"CONNECT" => Method::CONNECT,
other => {
return Err(PyValueError::new_err(format!(
"Unsupported HTTP method {}",
other
"Unsupported HTTP method {other}"
)))
}
};
Expand Down
4 changes: 2 additions & 2 deletions pyo3-object_store/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub fn register_store_module(
parent_module_str: &str,
sub_module_str: &str,
) -> PyResult<()> {
let full_module_string = format!("{}.{}", parent_module_str, sub_module_str);
let full_module_string = format!("{parent_module_str}.{sub_module_str}");

let child_module = PyModule::new(parent_module.py(), sub_module_str)?;

Expand Down Expand Up @@ -102,7 +102,7 @@ pub fn register_exceptions_module(
parent_module_str: &str,
sub_module_str: &str,
) -> PyResult<()> {
let full_module_string = format!("{}.{}", parent_module_str, sub_module_str);
let full_module_string = format!("{parent_module_str}.{sub_module_str}");

let child_module = PyModule::new(parent_module.py(), sub_module_str)?;

Expand Down
2 changes: 1 addition & 1 deletion pyo3-object_store/src/aws/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ impl PyS3Store {
prefix.as_ref()
)
} else {
format!("S3Store(bucket=\"{}\")", bucket)
format!("S3Store(bucket=\"{bucket}\")")
}
}

Expand Down
3 changes: 1 addition & 2 deletions pyo3-object_store/src/azure/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,7 @@ impl PyAzureStore {
)
} else {
format!(
"AzureStore(container_name=\"{}\", account_name=\"{}\")",
container_name, account_name,
"AzureStore(container_name=\"{container_name}\", account_name=\"{account_name}\")"
)
}
}
Expand Down
2 changes: 1 addition & 1 deletion pyo3-object_store/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ impl<'py> FromPyObject<'py> for PyClientOptions {
if &key == "default_headers" {
default_headers = Some(value.extract::<PyHeaderMap>()?);
} else {
return Err(PyValueError::new_err(format!("Invalid key: {}.", key)));
return Err(PyValueError::new_err(format!("Invalid key: {key}.")));
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions pyo3-object_store/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,7 @@ fn print_with_debug(err: &object_store::Error) -> String {
impl<'a, 'py> From<DowncastError<'a, 'py>> for PyObjectStoreError {
fn from(other: DowncastError<'a, 'py>) -> Self {
Self::PyErr(PyValueError::new_err(format!(
"Could not downcast: {}",
other
"Could not downcast: {other}",
)))
}
}
Expand Down
2 changes: 1 addition & 1 deletion pyo3-object_store/src/gcp/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ impl PyGCSStore {
prefix.as_ref()
)
} else {
format!("GCSStore(bucket=\"{}\")", bucket)
format!("GCSStore(bucket=\"{bucket}\")")
}
}

Expand Down
2 changes: 1 addition & 1 deletion pyo3-object_store/src/prefix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub struct MaybePrefixedStore<T: ObjectStore> {
impl<T: ObjectStore> std::fmt::Display for MaybePrefixedStore<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
if let Some(prefix) = self.prefix.as_ref() {
write!(f, "PrefixObjectStore({})", prefix)
write!(f, "PrefixObjectStore({prefix})")
} else {
write!(f, "ObjectStore")
}
Expand Down
5 changes: 2 additions & 3 deletions pyo3-object_store/src/simple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ pub fn from_url(
let store: PyMemoryStore = Arc::new(InMemory::new()).into();
Ok(store.into_py_any(py)?)
}
scheme => Err(GenericError::new_err(format!("Unknown URL scheme {:?}", scheme,)).into()),
scheme => Err(GenericError::new_err(format!("Unknown URL scheme {scheme:?}")).into()),
}
}

Expand All @@ -115,8 +115,7 @@ fn raise_if_config_passed(
) -> PyObjectStoreResult<()> {
if config.is_some() || kwargs.is_some() {
return Err(GenericError::new_err(format!(
"Cannot pass config or keyword parameters for scheme {:?}",
scheme,
"Cannot pass config or keyword parameters for scheme {scheme:?}"
))
.into());
}
Expand Down
Loading