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

Adding and removing a lone view #12

Open
j-gn opened this issue Sep 28, 2024 · 0 comments
Open

Adding and removing a lone view #12

j-gn opened this issue Sep 28, 2024 · 0 comments

Comments

@j-gn
Copy link

j-gn commented Sep 28, 2024

Adding and removing a single view returns an error.
It seems a bit unclear if this is intentional since the documentation hints that a lone root would be problematic.

let mut test_mux = Mux::new();
let node1 = test_mux.add_below(DummyView, test_mux.root).unwrap();
print_tree(&test_mux);
let result = test_mux.remove_id(node1);
println!("{result:?}");
Current Tree: 1,2,
Err(Generic)

Reference

/// Removes the given id from the multiplexer, returns an error if not a valid id contained in the tree or the lone root of the tree.
/// When successful the Id of the removed Node is returned.
pub fn remove_id(&mut self, id: Id) -> Result<Id, RemoveViewError>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant