Skip to content

Commit

Permalink
Fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmerlin committed Oct 10, 2024
1 parent 0ce5280 commit 33487e8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
8 changes: 5 additions & 3 deletions examples/querying.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,11 @@ fn make_tree() -> Harness<'static> {
_ = ui
.group(|ui| {
// TODO(lucasmerlin): Egui should probably group widgets by their parent automatically
ui.ctx().clone().with_accessibility_parent(group_label.id, || {
_ = ui.button("Duplicate");
});
ui.ctx()
.clone()
.with_accessibility_parent(group_label.id, || {
_ = ui.button("Duplicate");
});
})
.response
.labelled_by(group_label.id);
Expand Down
4 changes: 3 additions & 1 deletion src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ impl<'a> Debug for Node<'a> {
s.field("toggled", &toggled);
}

let children = self.query_all(by().recursive(false)).collect::<Vec<Node<'_>>>();
let children = self
.query_all(by().recursive(false))
.collect::<Vec<Node<'_>>>();

s.field("children", &children);

Expand Down
5 changes: 4 additions & 1 deletion src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ fn children(node: Node<'_>) -> impl Iterator<Item = Node<'_>> + '_ {
node.children().map(move |node| Node::new(node, queue))
}

fn children_maybe_recursive(node: Node<'_>, recursive: bool) -> Box<dyn Iterator<Item = Node<'_>> + '_> {
fn children_maybe_recursive(
node: Node<'_>,
recursive: bool,
) -> Box<dyn Iterator<Item = Node<'_>> + '_> {
if recursive {
children_recursive(node)
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/state.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use std::fmt::{Debug, Formatter};
use crate::event::Event;
use crate::query::Queryable;
use crate::Node;
use accesskit::TreeUpdate;
use parking_lot::Mutex;
use std::fmt::{Debug, Formatter};

/// The kittest state
pub struct State {
Expand Down

0 comments on commit 33487e8

Please sign in to comment.