-
Notifications
You must be signed in to change notification settings - Fork 612
WIP: teams #3334
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
base: master
Are you sure you want to change the base?
WIP: teams #3334
Conversation
To allow re-use for private override.
pub fn print_database_tree_info(&self, mut out: impl io::Write) -> anyhow::Result<()> { | ||
let fmt_names = |names: &BTreeSet<String>| match names.len() { | ||
0 => <_>::default(), | ||
1 => format!(": {}", names.first().unwrap()), | ||
_ => format!(": {names:?}"), | ||
}; | ||
|
||
let tree_info = &self.database_tree; | ||
|
||
write!(out, "{}{}", tree_info.root.identity, fmt_names(&tree_info.root.names))?; | ||
for (identity, info) in &tree_info.children { | ||
let names = fmt_names(&info.names); | ||
let parent = info | ||
.parent | ||
.map(|parent| format!(" (parent: {parent})")) | ||
.unwrap_or_default(); | ||
|
||
write!(out, "{identity}{parent}{names}")?; | ||
} | ||
|
||
Ok(()) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aasoni I have been a little un-imaginative about how to render the tree of children when trying to delete a parent. Note also that a database can have more than one name.
If you have a specific idea of how this should be rendered, please let me know.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe @bfops ?
WIP