mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-26 18:56:55 -06:00
ci: Rust 1.95 clippy and flaky Arabic PDF test after upstream merge
Co-authored-by: nrq6993-a11y <nrq6993-a11y@users.noreply.github.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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:?}");
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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"
|
||||
)});
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user