Rename alike to compatible
All checks were successful
Cargo CI / Build and Test (pull_request) Successful in 2m2s
Cargo CI / Lint (pull_request) Successful in 1m7s

This commit is contained in:
Wojciech Kozlowski 2025-01-02 14:45:11 +01:00
parent 02fb023ad1
commit 8a1447334e

View File

@ -41,11 +41,11 @@ pub struct AlbumId {
} }
impl AlbumId { impl AlbumId {
pub fn alike(&self, other: &AlbumId) -> bool { pub fn compatible(&self, other: &AlbumId) -> bool {
let titles_alike = self.title == other.title; let titles_compatible = self.title == other.title;
let lib_id_alike = let lib_id_compatible =
self.lib_id.is_none() || other.lib_id.is_none() || (self.lib_id == other.lib_id); 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 { impl Merge for AlbumMeta {
fn merge_in_place(&mut self, other: Self) { 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); self.seq = std::cmp::max(self.seq, other.seq);