From 20d5f3df0fba1055665c3df3f531853942b33b48 Mon Sep 17 00:00:00 2001 From: Kyle Barron Date: Tue, 8 Jul 2025 13:58:03 -0600 Subject: [PATCH 1/2] chore: Support Clippy 1.88 --- obstore/build.rs | 2 +- obstore/src/attributes.rs | 2 +- obstore/src/buffered.rs | 3 +-- obstore/src/list.rs | 2 +- obstore/src/put.rs | 3 +-- obstore/src/signer.rs | 3 +-- 6 files changed, 6 insertions(+), 9 deletions(-) diff --git a/obstore/build.rs b/obstore/build.rs index 96b74b0d..3dff9406 100644 --- a/obstore/build.rs +++ b/obstore/build.rs @@ -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()) diff --git a/obstore/src/attributes.rs b/obstore/src/attributes.rs index 54db4f0d..06ac81de 100644 --- a/obstore/src/attributes.rs +++ b/obstore/src/attributes.rs @@ -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:?}"), } } diff --git a/obstore/src/buffered.rs b/obstore/src/buffered.rs index 8d221434..48fcb892 100644 --- a/obstore/src/buffered.rs +++ b/obstore/src/buffered.rs @@ -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}" ))) } }; diff --git a/obstore/src/list.rs b/obstore/src/list.rs index 69c13d33..2e456aff 100644 --- a/obstore/src/list.rs +++ b/obstore/src/list.rs @@ -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(); diff --git a/obstore/src/put.rs b/obstore/src/put.rs index ed63441c..aef60221 100644 --- a/obstore/src/put.rs +++ b/obstore/src/put.rs @@ -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 { diff --git a/obstore/src/signer.rs b/obstore/src/signer.rs index cdaeb810..9fa11c91 100644 --- a/obstore/src/signer.rs +++ b/obstore/src/signer.rs @@ -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}" ))) } }; From cd60fe30de1ad97ffd79f57bc8398172904293b8 Mon Sep 17 00:00:00 2001 From: Kyle Barron Date: Tue, 8 Jul 2025 16:03:33 -0600 Subject: [PATCH 2/2] More lint fixes --- pyo3-object_store/src/api.rs | 4 ++-- pyo3-object_store/src/aws/store.rs | 2 +- pyo3-object_store/src/azure/store.rs | 3 +-- pyo3-object_store/src/client.rs | 2 +- pyo3-object_store/src/error.rs | 3 +-- pyo3-object_store/src/gcp/store.rs | 2 +- pyo3-object_store/src/prefix.rs | 2 +- pyo3-object_store/src/simple.rs | 5 ++--- 8 files changed, 10 insertions(+), 13 deletions(-) diff --git a/pyo3-object_store/src/api.rs b/pyo3-object_store/src/api.rs index 4a735035..ad22d32f 100644 --- a/pyo3-object_store/src/api.rs +++ b/pyo3-object_store/src/api.rs @@ -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)?; @@ -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)?; diff --git a/pyo3-object_store/src/aws/store.rs b/pyo3-object_store/src/aws/store.rs index a156cb7f..e87c6fc8 100644 --- a/pyo3-object_store/src/aws/store.rs +++ b/pyo3-object_store/src/aws/store.rs @@ -192,7 +192,7 @@ impl PyS3Store { prefix.as_ref() ) } else { - format!("S3Store(bucket=\"{}\")", bucket) + format!("S3Store(bucket=\"{bucket}\")") } } diff --git a/pyo3-object_store/src/azure/store.rs b/pyo3-object_store/src/azure/store.rs index 8e663462..74e04b96 100644 --- a/pyo3-object_store/src/azure/store.rs +++ b/pyo3-object_store/src/azure/store.rs @@ -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}\")" ) } } diff --git a/pyo3-object_store/src/client.rs b/pyo3-object_store/src/client.rs index 17066151..e6fb9e77 100644 --- a/pyo3-object_store/src/client.rs +++ b/pyo3-object_store/src/client.rs @@ -65,7 +65,7 @@ impl<'py> FromPyObject<'py> for PyClientOptions { if &key == "default_headers" { default_headers = Some(value.extract::()?); } else { - return Err(PyValueError::new_err(format!("Invalid key: {}.", key))); + return Err(PyValueError::new_err(format!("Invalid key: {key}."))); } } } diff --git a/pyo3-object_store/src/error.rs b/pyo3-object_store/src/error.rs index eaa0c9a9..b3d1aaf0 100644 --- a/pyo3-object_store/src/error.rs +++ b/pyo3-object_store/src/error.rs @@ -159,8 +159,7 @@ fn print_with_debug(err: &object_store::Error) -> String { impl<'a, 'py> From> for PyObjectStoreError { fn from(other: DowncastError<'a, 'py>) -> Self { Self::PyErr(PyValueError::new_err(format!( - "Could not downcast: {}", - other + "Could not downcast: {other}", ))) } } diff --git a/pyo3-object_store/src/gcp/store.rs b/pyo3-object_store/src/gcp/store.rs index 44ad589c..023002cd 100644 --- a/pyo3-object_store/src/gcp/store.rs +++ b/pyo3-object_store/src/gcp/store.rs @@ -178,7 +178,7 @@ impl PyGCSStore { prefix.as_ref() ) } else { - format!("GCSStore(bucket=\"{}\")", bucket) + format!("GCSStore(bucket=\"{bucket}\")") } } diff --git a/pyo3-object_store/src/prefix.rs b/pyo3-object_store/src/prefix.rs index e69b47f6..90212f1b 100644 --- a/pyo3-object_store/src/prefix.rs +++ b/pyo3-object_store/src/prefix.rs @@ -27,7 +27,7 @@ pub struct MaybePrefixedStore { impl std::fmt::Display for MaybePrefixedStore { 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") } diff --git a/pyo3-object_store/src/simple.rs b/pyo3-object_store/src/simple.rs index 9f9a99c9..0d54a09e 100644 --- a/pyo3-object_store/src/simple.rs +++ b/pyo3-object_store/src/simple.rs @@ -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()), } } @@ -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()); }