Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add unsafe fn remove_from_ptr for linked list #3

Merged
merged 1 commit into from
Nov 12, 2024
Merged

Conversation

MrCroxx
Copy link

@MrCroxx MrCroxx commented Nov 12, 2024

Add a useful helper.

    /// Remove an element from the pointer to it.
    ///
    /// # Safety
    ///
    /// `ptr` must be a pointer to an object that is part of this list.
    #[inline]
    pub unsafe fn remove_from_ptr(
        &mut self,
        ptr: *const <A::PointerOps as PointerOps>::Value,
    ) -> <A::PointerOps as PointerOps>::Pointer {
        self.cursor_mut_from_ptr(ptr).remove().unwrap()
    }

Signed-off-by: MrCroxx [email protected]

@MrCroxx MrCroxx added the enhancement New feature or request label Nov 12, 2024
@MrCroxx MrCroxx self-assigned this Nov 12, 2024
@MrCroxx MrCroxx merged commit 94cfac4 into foyer Nov 12, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant