Skip to content

Commit b055066

Browse files
committed
chore: Fix clippy warnings
Signed-off-by: Dmitry Dygalo <[email protected]>
1 parent c59f3b0 commit b055066

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

bindings/python/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## [Unreleased]
44

5+
### Changed
6+
7+
- Update `PyO3` to `0.23.0`.
8+
59
## [0.14.6] - 2024-12-27
610

711
### Fixed

bindings/python/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ crate-type = ["cdylib"]
1414
built = { version = "0.7.1", features = ["cargo-lock", "chrono"] }
1515

1616
[dependencies]
17-
pyo3 = { version = "0.22.0", features = ["extension-module", "abi3-py37"] }
18-
pyo3-built = "0.5"
17+
pyo3 = { version = "0.23.0", features = ["extension-module", "abi3-py37"] }
18+
pyo3-built = "0.6"
1919
rayon = "1"
2020
url = "2"
2121

bindings/python/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ fn inline_many_fragments_impl(
363363
Ok(output.map_err(InlineErrorWrapper)?)
364364
}
365365

366-
#[allow(dead_code)]
366+
#[allow(dead_code, clippy::needless_raw_string_hashes)]
367367
mod build {
368368
include!(concat!(env!("OUT_DIR"), "/built.rs"));
369369
}
@@ -377,7 +377,7 @@ fn css_inline(py: Python<'_>, module: &Bound<'_, PyModule>) -> PyResult<()> {
377377
module.add_wrapped(wrap_pyfunction!(inline_fragment))?;
378378
module.add_wrapped(wrap_pyfunction!(inline_many))?;
379379
module.add_wrapped(wrap_pyfunction!(inline_many_fragments))?;
380-
let inline_error = py.get_type_bound::<InlineError>();
380+
let inline_error = py.get_type::<InlineError>();
381381
inline_error.setattr("__doc__", INLINE_ERROR_DOCSTRING)?;
382382
module.add("InlineError", inline_error)?;
383383
module.add("__build__", pyo3_built::pyo3_built!(py, build))?;

css-inline/src/html/element.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ impl selectors::Element for Element<'_> {
183183
ns_url.clone(),
184184
local_name.clone().into_inner(),
185185
))
186-
.map_or(false, |value| operation.eval_str(value)),
186+
.is_some_and(|value| operation.eval_str(value)),
187187
}
188188
}
189189

@@ -236,9 +236,7 @@ impl selectors::Element for Element<'_> {
236236
fn has_id(&self, id: &LocalName, case_sensitivity: CaseSensitivity) -> bool {
237237
self.attributes()
238238
.get(local_name!("id"))
239-
.map_or(false, |id_attr| {
240-
case_sensitivity.eq(id.as_bytes(), id_attr.as_bytes())
241-
})
239+
.is_some_and(|id_attr| case_sensitivity.eq(id.as_bytes(), id_attr.as_bytes()))
242240
}
243241

244242
#[inline]

0 commit comments

Comments
 (0)