chipsenkbeil / vimwiki-rs

Rust library and tooling to parse, render, and modify vimwiki text and files.
56 stars 2 forks source link

Support IntoChildren for ref and mut ref #137

Closed chipsenkbeil closed 3 years ago

chipsenkbeil commented 3 years ago
impl<'a> IntoChildren for &'a Table<'a> {
    type Child = &'a Located<Cell<'a>>;

    fn into_children(self) -> Vec<Self::Child> {
        // ...
    }
}
impl<'a> IntoChildren for &'a mut Table<'a> {
    type Child = &'a mut Located<Cell<'a>>;

    fn into_children(self) -> Vec<Self::Child> {
        // ...
    }
}

Should also standardize existing IntoChildren impls to not transform inline elements, etc. but instead return the raw vec of immediate children elements.

chipsenkbeil commented 3 years ago

This isn't really important anymore, to my knowledge. Can't remember why I thought this was needed or relevant. Might have been related to supporting more implementations of AsChildrenSlice, but there are certain elements like DefinitionList that are a hashmap and don't support a slice. Going to close this out as I don't think I'm going to bother with this.