Skip to content

Commit

Permalink
src/node/inner.rs: replace impl Debug to Debug macro
Browse files Browse the repository at this point in the history
  • Loading branch information
niklak committed Oct 29, 2024
1 parent 65a6f9a commit 96b16ea
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions src/node/inner.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
use std::fmt::{self, Debug};
use std::fmt::Debug;

use super::node_data::{Element, NodeData};
use crate::NodeId;


/// The inner node is a [`crate::Tree`] node.
#[derive(Debug)]
pub struct TreeNode {
pub id: Option<NodeId>,
pub parent: Option<NodeId>,
Expand All @@ -30,20 +31,6 @@ impl TreeNode {
}
}

impl Debug for TreeNode {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fmt.debug_struct("Node")
.field("id", &self.id)
.field("parent", &self.parent)
.field("prev_sibling", &self.prev_sibling)
.field("next_sibling", &self.next_sibling)
.field("first_child", &self.first_child)
.field("last_child", &self.last_child)
.field("data", &self.data)
.finish()
}
}

impl TreeNode {
/// Checks if the node is a document node.
pub fn is_document(&self) -> bool {
Expand Down

0 comments on commit 96b16ea

Please sign in to comment.