style: cargo fmt --all

This commit is contained in:
2026-05-31 05:31:42 +02:00
parent 4b31a0f74b
commit c2ebca0da0
138 changed files with 2422 additions and 1164 deletions

View File

@@ -1,10 +1,10 @@
use std::sync::Arc;
use application::catalog::{GetAssetQuery, GetAssetHandler};
use application::testing::{InMemoryAssetRepository, InMemoryAssetMetadataRepository};
use application::catalog::{GetAssetHandler, GetAssetQuery};
use application::testing::{InMemoryAssetMetadataRepository, InMemoryAssetRepository};
use domain::catalog::entities::{Asset, AssetMetadata, AssetType, MetadataSource, SourceReference};
use domain::errors::DomainError;
use domain::ports::{AssetRepository, AssetMetadataRepository};
use domain::ports::{AssetMetadataRepository, AssetRepository};
use domain::value_objects::{Checksum, MetadataValue, StructuredData, SystemId};
use std::sync::Arc;
#[tokio::test]
async fn returns_asset_with_resolved_metadata() {
@@ -16,7 +16,13 @@ async fn returns_asset_with_resolved_metadata() {
relative_path: "photos/img.jpg".into(),
checksum: Checksum::new("a".repeat(64)).unwrap(),
};
let asset = Asset::new(source, AssetType::Image, "image/jpeg", 1024, SystemId::new());
let asset = Asset::new(
source,
AssetType::Image,
"image/jpeg",
1024,
SystemId::new(),
);
asset_repo.save(&asset).await.unwrap();
// Add exif layer
@@ -33,9 +39,12 @@ async fn returns_asset_with_resolved_metadata() {
meta_repo.save(&user_meta).await.unwrap();
let handler = GetAssetHandler::new(asset_repo, meta_repo);
let (returned, resolved) = handler.execute(GetAssetQuery {
asset_id: asset.asset_id,
}).await.unwrap();
let (returned, resolved) = handler
.execute(GetAssetQuery {
asset_id: asset.asset_id,
})
.await
.unwrap();
assert_eq!(returned.asset_id, asset.asset_id);
// UserEdited overrides ExifExtracted
@@ -50,9 +59,11 @@ async fn rejects_nonexistent() {
let meta_repo = Arc::new(InMemoryAssetMetadataRepository::new());
let handler = GetAssetHandler::new(asset_repo, meta_repo);
let result = handler.execute(GetAssetQuery {
asset_id: SystemId::new(),
}).await;
let result = handler
.execute(GetAssetQuery {
asset_id: SystemId::new(),
})
.await;
assert!(matches!(result, Err(DomainError::NotFound(_))));
}