Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Add as_mut, as_ref, as_inner, as_mut_inner, and into_inner for LocatedElement #50

Closed
chipsenkbeil opened this issue Oct 8, 2020 · 0 comments
Labels
refactoring Cleanup/changes that don't involve a new feature
Milestone

Comments

@chipsenkbeil
Copy link
Owner

chipsenkbeil commented Oct 8, 2020

Inspired by Option<T>, provide support for exposing the inner value of a LocatedElement.

This involves renaming the interior from element to inner and then providing these four methods, which will be useful in #12 and all of the graph-based issues where I need references to elements.

pub fn as_ref(&self) -> LE<&T>;
pub fn as_mut(&mut self) -> LE<&mut T>;
pub fn as_inner(&self) -> &T;
pub fn as_mut_inner(&mut self) -> &mut T;
pub fn into_inner(self) -> T;
@chipsenkbeil chipsenkbeil added the refactoring Cleanup/changes that don't involve a new feature label Oct 8, 2020
@chipsenkbeil chipsenkbeil added this to the MVP milestone Oct 8, 2020
@chipsenkbeil chipsenkbeil added this to To do in vimwiki-core via automation Oct 8, 2020
@chipsenkbeil chipsenkbeil changed the title Add as_mut, as_ref, as_inner, as_inner_mut, and into_inner for LocatedElement Add as_mut, as_ref, as_inner, as_mut_inner, and into_inner for LocatedElement Oct 8, 2020
vimwiki-core automation moved this from To do to Done Oct 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
refactoring Cleanup/changes that don't involve a new feature
Projects
vimwiki-core
  
Done
Development

No branches or pull requests

1 participant