Clear the clippy warnings that were failing CI before this branch
Build and test / Desktop (Linux) (push) Failing after 9m10s
Build and test / Layer separation (push) Successful in 27s
Traceability / Requirement traces (push) Failing after 24s
🐳 Android image / Build and push (push) Successful in 1s
Build and test / android-image (push) Successful in 1s
Build and test / Android (aarch64) (push) Failing after 22m15s

Nothing here is film simulation. These are lints that fail master today,
under the -D warnings CI runs with, mostly from a toolchain that learned
new ones rather than from anybody's code -- is_multiple_of and the
derivable Default did not exist as lints when this was written.

They are fixed rather than allowed, and by hand rather than by trusting
cargo clippy --fix wholesale: its automatic pass split a derive in two and
left a stray blank line, which is the sort of thing that is correct and
still wrong to commit.

The four that needed a decision rather than a rewrite:

  - the distance transform's inner loop writes through its iterator now.
     stays, because it is the position the parabola is evaluated at as
    well as the index it is written to -- the lint is about the write.
  -  and  take  by value. Their receiver is
    Copy, so this is the same machine code and the honest signature.
  - the export path's return type is five levels deep and now has a name,
    plus a line saying why the Option wraps the Result: None is
    cancellation, which is not a failure and has no error to report.
  - a test fills a range instead of looping over one.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-25 22:34:38 +02:00
co-authored by Claude Opus 5
parent 3b5952769b
commit e929e9917e
11 changed files with 145 additions and 124 deletions
+18 -18
View File
@@ -2936,6 +2936,24 @@ fn unit_suffix(unit: Unit) -> &'static str {
}
}
/// `dr_pipeline`'s morphology, as `dr_segment` names it.
///
/// Two enums for one idea, and deliberately: `dr-pipeline` describes the
/// *edit* and `dr-segment` implements the *transform*, and neither depends on
/// the other. The crossing is this function, which the compiler makes
/// exhaustive on both sides.
fn morphology_for(m: dr_pipeline::mask::Morphology) -> dr_segment::Morphology {
use dr_pipeline::mask::Morphology as Edit;
use dr_segment::Morphology as Transform;
match m {
Edit::None => Transform::None,
Edit::Dilate => Transform::Dilate,
Edit::Erode => Transform::Erode,
Edit::Close => Transform::Close,
Edit::Open => Transform::Open,
}
}
#[cfg(test)]
mod tests {
use super::*;
@@ -4712,21 +4730,3 @@ mod tests {
assert_eq!(session.rows().len(), all);
}
}
/// `dr_pipeline`'s morphology, as `dr_segment` names it.
///
/// Two enums for one idea, and deliberately: `dr-pipeline` describes the
/// *edit* and `dr-segment` implements the *transform*, and neither depends on
/// the other. The crossing is this function, which the compiler makes
/// exhaustive on both sides.
fn morphology_for(m: dr_pipeline::mask::Morphology) -> dr_segment::Morphology {
use dr_pipeline::mask::Morphology as Edit;
use dr_segment::Morphology as Transform;
match m {
Edit::None => Transform::None,
Edit::Dilate => Transform::Dilate,
Edit::Erode => Transform::Erode,
Edit::Close => Transform::Close,
Edit::Open => Transform::Open,
}
}
+14 -11
View File
@@ -672,23 +672,26 @@ fn carried_metadata(meta: &dr_decode::Metadata) -> dr_export::SourceMetadata {
}
}
/// One rendered photograph on its way to a file: the name it will be written
/// under, the name it came from, the pixels, and whatever metadata travelled
/// with them.
type RenderedItem = (
String,
String,
dr_export::Frame,
Option<dr_export::SourceMetadata>,
);
/// Fetch a photograph, apply its stored edit, and render it at full size.
///
/// `None` means the work was cancelled, which is not a failure and has no
/// error to report — hence the `Option` outside the `Result`.
fn render_from_library(
request: &BatchRequest,
path: &str,
cache: Option<crate::library::CacheContext>,
cancel: &Cancel,
) -> Option<
Result<
(
String,
String,
dr_export::Frame,
Option<dr_export::SourceMetadata>,
),
ItemError,
>,
> {
) -> Option<Result<RenderedItem, ItemError>> {
let Some((creds, user_id)) = request.creds.clone() else {
return Some(Err(ItemError::Fetch("no library is open".into())));
};