Cleanup unused message embedding code
Fixup some warnings
This commit is contained in:
17
src/files.rs
17
src/files.rs
@@ -233,12 +233,8 @@ pub async fn list_photos<TagD: TagDao, FS: FileSystemAccess>(
|
||||
if let (Some(photo_lat), Some(photo_lon)) =
|
||||
(exif.gps_latitude, exif.gps_longitude)
|
||||
{
|
||||
let distance = haversine_distance(
|
||||
lat,
|
||||
lon,
|
||||
photo_lat as f64,
|
||||
photo_lon as f64,
|
||||
);
|
||||
let distance =
|
||||
haversine_distance(lat, lon, photo_lat as f64, photo_lon as f64);
|
||||
distance <= radius_km
|
||||
} else {
|
||||
false
|
||||
@@ -410,9 +406,13 @@ pub async fn list_photos<TagD: TagDao, FS: FileSystemAccess>(
|
||||
)
|
||||
})
|
||||
.map(|path: &PathBuf| {
|
||||
let relative = path.strip_prefix(&app_state.base_path).unwrap_or_else(|_| panic!("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()));
|
||||
path.display()
|
||||
)
|
||||
});
|
||||
relative.to_path_buf()
|
||||
})
|
||||
.map(|f| f.to_str().unwrap().to_string())
|
||||
@@ -791,6 +791,7 @@ pub struct RealFileSystem {
|
||||
}
|
||||
|
||||
impl RealFileSystem {
|
||||
#[allow(dead_code)] // Used in main.rs binary and tests
|
||||
pub(crate) fn new(base_path: String) -> RealFileSystem {
|
||||
RealFileSystem { base_path }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user