Skip to content

PhotoCraft: An open-source, photo editor written by scratch in pure Rust

Integration: cargo fmt

aiongg5a01650652c2
diff --git a/crates/io/src/svg.rs b/crates/io/src/svg.rs
index 3d66f45e9..8afefb733 100644
--- a/crates/io/src/svg.rs
+++ b/crates/io/src/svg.rs
@@ -230,17 +230,8 @@ fn import_parsed_with_budget(name: &str, parsed: Parsed, max_group_depth: usize,
let fmt = doc.pixel_format();
let global = tiny_skia::Transform::from_scale(cv.scale, cv.scale);
let max_group_depth = (max_group_depth != 0).then_some(max_group_depth.clamp(1, MAX_GROUP_DEPTH));
- let mut conv = Conv {
- fmt,
- canvas: doc.bounds(),
- global,
- max_group_depth,
- warnings,
- noted: Vec::new(),
- counts: [0; 4],
- pixel_budget,
- retained_pixel_bytes: 0,
- };
+ let mut conv =
+ Conv { fmt, canvas: doc.bounds(), global, max_group_depth, warnings, noted: Vec::new(), counts: [0; 4], pixel_budget, retained_pixel_bytes: 0 };
if count_nodes(tree.root()) > MAX_NODES {
conv.warnings.push(format!("SVG: more than {MAX_NODES} elements; opened as one pixel layer instead of shapes"));
let (w, h) = (cv.size.width, cv.size.height);
diff --git a/crates/ui-egui/src/discard_ui.rs b/crates/ui-egui/src/discard_ui.rs
index fe75cadc3..82e4497d9 100644
--- a/crates/ui-egui/src/discard_ui.rs
+++ b/crates/ui-egui/src/discard_ui.rs
@@ -215,7 +215,11 @@ fn save(app: &mut PhotocraftApp, ctx: &egui::Context, doc: DocId) -> bool {
match saved {
// A Save Document script may have edited the document after it was written: still dirty.
// A write the platform can't confirm (a web download) leaves it dirty too, and counts.
- Ok(_) => !app.save_options_open() && !app.saving() && index_of(app, doc).is_some_and(|i| app.services.write_unconfirmed || !app.session.documents()[i].is_dirty()),
+ Ok(_) => {
+ !app.save_options_open()
+ && !app.saving()
+ && index_of(app, doc).is_some_and(|i| app.services.write_unconfirmed || !app.session.documents()[i].is_dirty())
+ }
// Backing out of the file dialog is the user's choice, not an error.
Err(e) if e == crate::file_dialog::CANCELLED => false,
Err(e) => {