-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Creating a Tree
is expensive
#3
Comments
I wonder if we could create a pub trait Tree {
fn root(&self) -> &Display;
fn leaves(&self) -> Box<Iterator<Item=&Tree>>;
fn display(&self) -> DisplayTree;
}
pub struct DisplayTree(...);
impl Display for DisplayTree {
...
} This would allow heterogeneous nodes, reducing unnecessary The existing |
Finnaly, Fixes assert-rs#7. Inspired by the work in assert-rs#39. Created softprops/treeline#3 for trying to find ways to make this more efficient.
Finnaly, Fixes assert-rs#7. Inspired by the work in assert-rs#39. Created softprops/treeline#3 for trying to find ways to make this more efficient.
In like your idea. If you have some time I'd be open to a PR. Otherwise I can take a look |
Unfortunately, this is one of the lower items on my priority list (using various tricks to avoid If curious, you can see my use of |
I have mixed feelings about the For my use case, I'm probably going to do this pub trait CasseTreeDisplayExt {
fn tree(&self) -> CaseTree;
}
pub CaseTree(Case);
impl Tree for CaseTree and ideally, |
Finnaly, Fixes assert-rs#7. Inspired by the work in assert-rs#39. Created softprops/treeline#3 for trying to find ways to make this more efficient.
Finnaly, Fixes assert-rs#7. Inspired by the work in assert-rs#39. Created softprops/treeline#3 for trying to find ways to make this more efficient.
Finnaly, Fixes assert-rs#7. Inspired by the work in assert-rs#39. Created softprops/treeline#3 for trying to find ways to make this more efficient.
I am using this crate to show what parts of an assertion failed and why (see assert-rs/predicates-rs#7).
For simple nodes, it seems like the current API is great. Unfortunately, I have heterogeneous nodes for my expression tree. so with
treeline
s current API, I have to copy this into atreeline
specific tree and convert each of my nodes into aBox<Display>
to conform to the API, making a lot of unnecessary work.The text was updated successfully, but these errors were encountered: