Skip to content

LightCraft: An open-source non-destructive photo editor written by scratch in pure Rust

Batch 30: cargo fmt over the merged PRs

Claude47b5e0ae1b9f
diff --git a/crates/engine/src/smart.rs b/crates/engine/src/smart.rs
index b607d84d8..3628f188c 100644
--- a/crates/engine/src/smart.rs
+++ b/crates/engine/src/smart.rs
@@ -202,9 +202,11 @@ pub fn migrate(from: &Path, to: &Path, what: Existing) -> (usize, Vec<String>) {
}
for src in files(from) {
let Some(name) = src.file_name() else { continue };
- let dst = name.to_str().and_then(|n| n.strip_suffix(".lcsp")).filter(|stem| {
- stem.len() == 32 && stem.bytes().all(|b| b.is_ascii_hexdigit() && !b.is_ascii_uppercase())
- }).map_or_else(|| to.join(name), |stem| to.join(&stem[..2]).join(name));
+ let dst = name
+ .to_str()
+ .and_then(|n| n.strip_suffix(".lcsp"))
+ .filter(|stem| stem.len() == 32 && stem.bytes().all(|b| b.is_ascii_hexdigit() && !b.is_ascii_uppercase()))
+ .map_or_else(|| to.join(name), |stem| to.join(&stem[..2]).join(name));
let r = match what {
Existing::Discard => std::fs::remove_file(&src),
_ => {
diff --git a/crates/ui-egui/src/panels/right.rs b/crates/ui-egui/src/panels/right.rs
index 5bd4f98d0..501a78c5e 100644
--- a/crates/ui-egui/src/panels/right.rs
+++ b/crates/ui-egui/src/panels/right.rs
@@ -694,16 +694,11 @@ fn info(app: &mut LightcraftApp, ui: &mut egui::Ui, id: PhotoId) {
if let lightcraft_catalog::Source::File { path } = &p.source {
let avail = &app.session.media.availability;
let online = !avail.is_offline(path);
- let smart = app
- .session
- .media
- .smart_dir
- .as_ref()
- .is_some_and(|d| {
- let shard = lightcraft_engine::smart::sharded_file_path(d, &p);
- let legacy = d.join(lightcraft_engine::smart::file_name(&p));
- avail.exists(&shard.to_string_lossy()) == Some(true) || avail.exists(&legacy.to_string_lossy()) == Some(true)
- });
+ let smart = app.session.media.smart_dir.as_ref().is_some_and(|d| {
+ let shard = lightcraft_engine::smart::sharded_file_path(d, &p);
+ let legacy = d.join(lightcraft_engine::smart::file_name(&p));
+ avail.exists(&shard.to_string_lossy()) == Some(true) || avail.exists(&legacy.to_string_lossy()) == Some(true)
+ });
if !online || smart {
let text = match (online, smart) {
(false, true) => "Original offline · editing the smart preview",