hls: cargo fmt + clippy::cloned_ref_to_slice_refs
Pure mechanical pass on the files this branch added/modified: rustfmt reflow of a few long lines / chains, and the one non-pre-existing clippy warning — replacing `&[rel_path.clone()]` with `std::slice::from_ref(&rel_path)` in `handlers::video::generate_video` to avoid the alloc + clone for a single-element slice. All 707 tests still pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -80,11 +80,10 @@ pub async fn generate_video(
|
||||
return HttpResponse::BadRequest().finish();
|
||||
};
|
||||
|
||||
let preferred_library =
|
||||
libraries::resolve_library_param(&app_state, body.library.as_deref())
|
||||
.ok()
|
||||
.flatten()
|
||||
.unwrap_or_else(|| app_state.primary_library());
|
||||
let preferred_library = libraries::resolve_library_param(&app_state, body.library.as_deref())
|
||||
.ok()
|
||||
.flatten()
|
||||
.unwrap_or_else(|| app_state.primary_library());
|
||||
|
||||
// Try the resolved library first, then fall back to any other library
|
||||
// that actually contains the file — handles union-mode requests where
|
||||
@@ -122,7 +121,11 @@ pub async fn generate_video(
|
||||
// already-ingested videos.
|
||||
let hash_from_db: Option<String> = {
|
||||
let mut dao = exif_dao.lock().expect("Unable to lock ExifDao");
|
||||
match dao.get_exif_batch(&context, Some(resolved_library_id), &[rel_path.clone()]) {
|
||||
match dao.get_exif_batch(
|
||||
&context,
|
||||
Some(resolved_library_id),
|
||||
std::slice::from_ref(&rel_path),
|
||||
) {
|
||||
Ok(rows) => rows.into_iter().next().and_then(|r| r.content_hash),
|
||||
Err(e) => {
|
||||
warn!(
|
||||
|
||||
Reference in New Issue
Block a user