Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
REVIEW: Fix stale doc comment referencing InsertionError::Protected
Fintan Halpenny committed 22 days ago
commit a8cf4080ce7f4442fa4ad3adc2b907a2fe04d55b
parent c9c75621fad41dc4e1339012f758b270f94bb23b
1 file changed +12 -4
modified crates/radicle/src/git/canonical/symbolic.rs
@@ -119,10 +119,18 @@ pub enum InsertionError {
/// Mutability.
impl SymbolicRefs {
    /// Insert a symbolic reference.
-
    /// Even though this method will never return [`InsertionError::Protected`]
-
    /// we opt to return that (slightly more general) error, as it allows
-
    /// construction of [`InsertionError::Cyclic`] by consuming `name` and
-
    /// `target`, avoiding an early copy in [`Self::try_insert`].
+
    ///
+
    /// # Errors
+
    ///
+
    /// The `target` reference must either:
+
    /// - Be a direct [`Qualified`] reference, or
+
    /// - Resolve to a direct [`Qualified`] reference, if it is a keyed entry in [`SymbolicRefs`].
+
    ///
+
    /// If neither of these is satisfied then an
+
    /// [`InsertionError::TargetNotQualified`] error is returned.
+
    ///
+
    /// If the `name` and `target` end up in a cycle, e.g., `a → b → a`, then an
+
    /// [`InsertionError::Cyclic`] error is returned.
    pub(super) fn try_insert_unprotected(
        &mut self,
        name: Name,