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::*;
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
///
/// * `k` - The key to check for.
/// * `id` - The ID to check for.
///
/// # 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.
///
/// # Errors
///
/// Returns `Err(FailedTo::LockCatalog)` if the catalog's internal mutex
/// could not be locked.
pub fn contains_key(&self, k: &str) -> Result<bool, FailedTo> {
self.with_items(|items| Ok(items.contains_key(k)))
pub fn contains_key(&self, id: &str) -> Result<bool, FailedTo> {
self.with_items(|items| Ok(items.contains_key(id)))
}
}