chore: rename key parameter to id while checking for existence

This commit is contained in:
2026-02-06 08:57:12 +01:00
parent 46ab14738d
commit 7718daddda

View File

@@ -1,22 +1,22 @@
use crate::*; use crate::*;
impl Catalog { impl Catalog {
/// Checks if the catalog contains an entity with the specified key. /// Checks if the catalog contains an entity with the specified ID.
/// ///
/// # Arguments /// # Arguments
/// ///
/// * `k` - The key to check for. /// * `id` - The ID to check for.
/// ///
/// # Returns /// # Returns
/// ///
/// `Ok(true)` if an entity with the specified key exists in the catalog, /// `Ok(true)` if an entity with the specified ID exists in the catalog,
/// `Ok(false)` otherwise. /// `Ok(false)` otherwise.
/// ///
/// # Errors /// # Errors
/// ///
/// Returns `Err(FailedTo::LockCatalog)` if the catalog's internal mutex /// Returns `Err(FailedTo::LockCatalog)` if the catalog's internal mutex
/// could not be locked. /// could not be locked.
pub fn contains_key(&self, k: &str) -> Result<bool, FailedTo> { pub fn contains_key(&self, id: &str) -> Result<bool, FailedTo> {
self.with_items(|items| Ok(items.contains_key(k))) self.with_items(|items| Ok(items.contains_key(id)))
} }
} }