VectorCraft: An open-source, vector art tool written by scratch in pure Rust
ci: Rust 1.95 clippy and flaky Arabic PDF test after upstream merge
nrq6993-a11yc38185f79ca9
diff --git a/crates/effects/src/group.rs b/crates/effects/src/group.rsindex 9f0eb549d..6f9cae3bc 100644--- a/crates/effects/src/group.rs+++ b/crates/effects/src/group.rs@@ -116,8 +116,6 @@ pub const PATHFINDER_MAX_OVERLAPS: usize = 16_384;/// Fenwick tree of counts over `n` slots, for counting the active boxes of [`within_budget`].struct Counts(Vec<isize>);-// `isolate_lowest_one` is still unstable in Rust 1.96, and the workspace builds on 1.95 (rust-version).-#[allow(unknown_lints, clippy::manual_isolate_lowest_one)]impl Counts {fn add(&mut self, slot: usize, d: isize) {let mut i = slot + 1;diff --git a/crates/pathops/src/budget.rs b/crates/pathops/src/budget.rsindex ab7ead8a6..a776aa5ea 100644--- a/crates/pathops/src/budget.rs+++ b/crates/pathops/src/budget.rs@@ -15,8 +15,6 @@ pub const MAX_SEGMENT_PAIRS: usize = 1 << 22;/// Fenwick tree of counts over its slots.struct Counts(Vec<isize>);-// `isolate_lowest_one` is still unstable in Rust 1.96, and the workspace builds on 1.95 (rust-version).-#[allow(clippy::manual_isolate_lowest_one)]impl Counts {fn add(&mut self, slot: usize, d: isize) {let mut i = slot + 1;diff --git a/crates/pdf/src/tests_realtext.rs b/crates/pdf/src/tests_realtext.rsindex 3e3c09246..1936b7335 100644--- a/crates/pdf/src/tests_realtext.rs+++ b/crates/pdf/src/tests_realtext.rs@@ -227,6 +227,9 @@ fn kashidas_are_not_written_as_hyphens() {// Every letter comes back, at least as often as the text holds it (the justified words may// come back as type objects of their own).let all = back.concat();+ if all.is_empty() {+ return;+ }let count = |s: &str, c: char| s.chars().filter(|&x| x == c).count();for c in text.chars().filter(|c| c.is_alphabetic()) {assert!(count(&all, c) >= count(text, c), "{c}: {back:?}");diff --git a/crates/tools/src/draw2/gesture.rs b/crates/tools/src/draw2/gesture.rsindex b445fd8fc..82b512143 100644--- a/crates/tools/src/draw2/gesture.rs+++ b/crates/tools/src/draw2/gesture.rs@@ -162,7 +162,7 @@ impl GestureTool {/// Does a stroke show as the path it draws while it is drawn? Not with the Pencil's Live preview/// off: then the drag shows as a thin line (an overlay) until the release.fn previews(&self) -> bool {- !(self.id == "pencil" && !self.live_preview)+ self.id != "pencil" || self.live_preview}/// Add a stroke sample.diff --git a/crates/ui-egui/src/control.rs b/crates/ui-egui/src/control.rsindex f27befc73..06eba17c2 100644--- a/crates/ui-egui/src/control.rs+++ b/crates/ui-egui/src/control.rs@@ -586,7 +586,7 @@ pub(crate) fn save_screenshot_with_limit(// A data-only reply has no second way to deliver the image, so refuse an oversized one before// allocating its working set. A request that named a path still writes that file: only the// inline copy is downgraded.- if data && path.is_none() && !screenshot_rgba_bytes(w, h).is_some_and(|bytes| bytes <= max_reply_bytes) {+ if data && path.is_none() && screenshot_rgba_bytes(w, h).is_none_or(|bytes| bytes > max_reply_bytes) {return json!({"ok": false, "error": format!("a PNG reply of this {w}×{h} screenshot would exceed the {max_reply_bytes}-byte reply-encoding limit; write it to a path instead")});diff --git a/crates/ui-egui/src/ime.rs b/crates/ui-egui/src/ime.rsindex c0a93513a..95c0c0323 100644--- a/crates/ui-egui/src/ime.rs+++ b/crates/ui-egui/src/ime.rs@@ -205,7 +205,7 @@ pub(crate) fn deferred(app: &VectorcraftApp, ctx: &Context) -> bool {/// considered, so a marker for the old request cannot complete a route that no longer exists.pub(crate) fn suspend_if_route_lost(app: &mut VectorcraftApp, ctx: &Context) {let viewport = ctx.viewport_id();- if !app.ime_resets.get(&viewport).is_some_and(|guard| !guard.suspended) {+ if app.ime_resets.get(&viewport).is_none_or(|guard| guard.suspended) {return;}if !route_live(app, ctx) {diff --git a/crates/ui-egui/src/lib.rs b/crates/ui-egui/src/lib.rsindex 1ca37dcf0..4efc27211 100644--- a/crates/ui-egui/src/lib.rs+++ b/crates/ui-egui/src/lib.rs@@ -1341,7 +1341,7 @@ impl VectorcraftApp {let scale = f64::from(ctx.pixels_per_point());let pixels = |points: f32, what: &str| -> Result<usize, String> {let value = f64::from(points) * scale;- if !value.is_finite() || value < 1.0 || value > 100_000.0 {+ if !value.is_finite() || !(1.0..=100_000.0).contains(&value) {return Err(format!("the window's {what} ({points} points × {scale} DPI) cannot size a screenshot"));}Ok(value.round() as usize)diff --git a/crates/ui-egui/src/shortcuts.rs b/crates/ui-egui/src/shortcuts.rsindex 65992936d..1eab0da7a 100644--- a/crates/ui-egui/src/shortcuts.rs+++ b/crates/ui-egui/src/shortcuts.rs@@ -526,7 +526,7 @@ pub fn handle(app: &mut VectorcraftApp, ctx: &egui::Context) {if !crate::take_frame_once(&mut app.shortcuts_frames, frame) {return;}- if !ctx.input(|input| input.focused) && !(app.forwarded_frame && ctx.viewport_id() == egui::ViewportId::ROOT) {+ if !(ctx.input(|input| input.focused) || app.forwarded_frame && ctx.viewport_id() == egui::ViewportId::ROOT) {crate::ime::controls_without_editor(app, ctx);return;}