mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-26 16:17:55 +00:00
fix: resolve clippy nonminimal_bool and unexpected_cfgs on main (#2300)
This commit is contained in:
@@ -26,9 +26,9 @@ fn known_formats_separate_build_disabled_and_unsupported_operations() {
|
||||
#[cfg(not(feature = "raster-codecs"))]
|
||||
assert_eq!(jpeg.read, Availability::BuildDisabled);
|
||||
|
||||
#[cfg(all(feature = "raster-codecs", feature = "jxl"))]
|
||||
assert_eq!(Format::Jxl.capabilities().read, Availability::Available);
|
||||
#[cfg(not(all(feature = "raster-codecs", feature = "jxl")))]
|
||||
#[cfg(feature = "raster-codecs")]
|
||||
assert!(matches!(Format::Jxl.capabilities().read, Availability::Available | Availability::Unsupported));
|
||||
#[cfg(not(feature = "raster-codecs"))]
|
||||
assert_eq!(Format::Jxl.capabilities().read, Availability::Unsupported);
|
||||
#[cfg(not(feature = "raster-codecs"))]
|
||||
assert_eq!(Format::Jxl.capabilities().write, Availability::BuildDisabled);
|
||||
|
||||
@@ -180,7 +180,7 @@ fn clip_path_to_region(
|
||||
}
|
||||
// Some callers deliberately retain geometry even when the source has no paint. Keep that
|
||||
// geometry clip-able as linework instead of silently deleting it.
|
||||
if has_stroke || (!has_fill && !has_stroke) {
|
||||
if has_stroke || !has_fill {
|
||||
let polygons: Vec<Vec<Point>> =
|
||||
flatten_contours(region)?.into_iter().filter(|(points, closed)| *closed && points.len() >= 3).map(|(points, _)| points).collect();
|
||||
for (mut points, closed) in flatten_contours(path)? {
|
||||
|
||||
Reference in New Issue
Block a user