refactor: fix all clippy warnings properly
- UserProfile struct groups display_name/bio/avatar/banner/also_known_as/profile_fields - User::from_persistence takes UserProfile (6 args, was 11) - PersistedReview struct for Review::from_persistence (1 arg, was 8) - WatchlistApInput struct for watchlist_to_ap_object (1 arg, was 8) - ActivityPubDeps struct for activitypub::wire (1 arg, was 11) - FederationRepos type alias for wire() return types - FeedSortBy: impl std::str::FromStr instead of inherent from_str - postgres users.rs: row_to_user takes &PgRow like sqlite - collapse nested ifs in multipart handlers - type alias for complex return types (image-converter, worker) - tui: allow large_enum_variant at crate level (pre-existing, unrelated)
This commit is contained in:
@@ -117,11 +117,10 @@ impl ResolutionStrategy for TitleSearchStrategy {
|
||||
match deps.metadata_client.fetch_movie_metadata(&criteria).await {
|
||||
Ok(m) => {
|
||||
// Movie may already exist in DB under this external_metadata_id
|
||||
if let Some(ext_id) = m.external_metadata_id() {
|
||||
if let Some(existing) = deps.repository.get_movie_by_external_id(ext_id).await?
|
||||
{
|
||||
return Ok(Some((existing, false)));
|
||||
}
|
||||
if let Some(ext_id) = m.external_metadata_id()
|
||||
&& let Some(existing) = deps.repository.get_movie_by_external_id(ext_id).await?
|
||||
{
|
||||
return Ok(Some((existing, false)));
|
||||
}
|
||||
Ok(Some((m, true)))
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@ impl EventHandler for RecordingHandler {
|
||||
"watchlist"
|
||||
}
|
||||
DomainEvent::FollowAccepted { .. } => "follow_accepted",
|
||||
DomainEvent::BackfillFollower { .. } => "backfill_follower",
|
||||
};
|
||||
self.calls.lock().unwrap().push(label);
|
||||
Ok(())
|
||||
|
||||
@@ -68,11 +68,14 @@ pub async fn execute(ctx: &AppContext, cmd: UpdateProfileCommand) -> Result<(),
|
||||
ctx.user_repository
|
||||
.update_profile(
|
||||
&user_id,
|
||||
cmd.display_name,
|
||||
cmd.bio,
|
||||
new_avatar_path,
|
||||
new_banner_path,
|
||||
cmd.also_known_as,
|
||||
&domain::models::UserProfile {
|
||||
display_name: cmd.display_name,
|
||||
bio: cmd.bio,
|
||||
avatar_path: new_avatar_path,
|
||||
banner_path: new_banner_path,
|
||||
also_known_as: cmd.also_known_as,
|
||||
profile_fields: vec![],
|
||||
},
|
||||
)
|
||||
.await?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user