From 8a1447334eb87efb1769434ab5f9b79ec4cad419 Mon Sep 17 00:00:00 2001 From: Wojciech Kozlowski Date: Thu, 2 Jan 2025 14:45:11 +0100 Subject: [PATCH] Rename alike to compatible --- src/core/collection/album.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/collection/album.rs b/src/core/collection/album.rs index c10f9d5..b402008 100644 --- a/src/core/collection/album.rs +++ b/src/core/collection/album.rs @@ -41,11 +41,11 @@ pub struct AlbumId { } impl AlbumId { - pub fn alike(&self, other: &AlbumId) -> bool { - let titles_alike = self.title == other.title; - let lib_id_alike = + pub fn compatible(&self, other: &AlbumId) -> bool { + let titles_compatible = self.title == other.title; + let lib_id_compatible = self.lib_id.is_none() || other.lib_id.is_none() || (self.lib_id == other.lib_id); - titles_alike && lib_id_alike + titles_compatible && lib_id_compatible } } @@ -268,7 +268,7 @@ impl Ord for AlbumMeta { impl Merge for AlbumMeta { fn merge_in_place(&mut self, other: Self) { - assert!(self.id.alike(&other.id)); + assert!(self.id.compatible(&other.id)); self.seq = std::cmp::max(self.seq, other.seq);