Run clippy fix
This commit is contained in:
17
src/files.rs
17
src/files.rs
@@ -234,8 +234,8 @@ pub async fn list_photos<TagD: TagDao, FS: FileSystemAccess>(
|
||||
(exif.gps_latitude, exif.gps_longitude)
|
||||
{
|
||||
let distance = haversine_distance(
|
||||
lat as f64,
|
||||
lon as f64,
|
||||
lat,
|
||||
lon,
|
||||
photo_lat as f64,
|
||||
photo_lon as f64,
|
||||
);
|
||||
@@ -344,7 +344,7 @@ pub async fn list_photos<TagD: TagDao, FS: FileSystemAccess>(
|
||||
sort_type,
|
||||
&mut exif_dao_guard,
|
||||
&span_context,
|
||||
(&app_state.base_path).as_ref(),
|
||||
app_state.base_path.as_ref(),
|
||||
);
|
||||
drop(exif_dao_guard);
|
||||
result
|
||||
@@ -410,14 +410,9 @@ pub async fn list_photos<TagD: TagDao, FS: FileSystemAccess>(
|
||||
)
|
||||
})
|
||||
.map(|path: &PathBuf| {
|
||||
let relative = path.strip_prefix(&app_state.base_path).expect(
|
||||
format!(
|
||||
"Unable to strip base path {} from file path {}",
|
||||
let relative = path.strip_prefix(&app_state.base_path).unwrap_or_else(|_| panic!("Unable to strip base path {} from file path {}",
|
||||
&app_state.base_path.path(),
|
||||
path.display()
|
||||
)
|
||||
.as_str(),
|
||||
);
|
||||
path.display()));
|
||||
relative.to_path_buf()
|
||||
})
|
||||
.map(|f| f.to_str().unwrap().to_string())
|
||||
@@ -493,7 +488,7 @@ pub async fn list_photos<TagD: TagDao, FS: FileSystemAccess>(
|
||||
sort_type,
|
||||
&mut exif_dao_guard,
|
||||
&span_context,
|
||||
(&app_state.base_path).as_ref(),
|
||||
app_state.base_path.as_ref(),
|
||||
);
|
||||
drop(exif_dao_guard);
|
||||
result
|
||||
|
||||
Reference in New Issue
Block a user