diff --git a/Cargo.toml b/Cargo.toml index d8a7259..355c69b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,6 +4,8 @@ version = "0.9.0" edition = "2024" description = "Offensive-first HTTP library with Python bindings" license = "GPL-3.0" +# CI-only pin. Shipping it would override the toolchain of anyone building from the sdist. +exclude = ["rust-toolchain.toml"] [lib] # When building as a Python module, we need a cdylib (shared library). diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..1199015 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,4 @@ +# Pinned so new clippy lints don't break dependabot PRs. Bump deliberately, fixing new lints in the same commit. +[toolchain] +channel = "1.97.1" +components = ["clippy", "rustfmt"] diff --git a/src/mock.rs b/src/mock.rs index d7a63de..133d263 100644 --- a/src/mock.rs +++ b/src/mock.rs @@ -838,7 +838,7 @@ impl PyBlasthttpMock { Some(body_obj) }; let files_obj = bound.getattr("files").ok(); - let files = files_obj.and_then(|f| if f.is_none() { None } else { Some(f) }); + let files = files_obj.filter(|f| !f.is_none()); let (body_bytes, final_headers) = crate::python::apply_body_and_files(body, files, headers)?; mock_entries.push(MockBatchEntry {