diff --git a/src/smart-pointers/exercise.rs b/src/smart-pointers/exercise.rs index a958b582..052a791d 100644 --- a/src/smart-pointers/exercise.rs +++ b/src/smart-pointers/exercise.rs @@ -18,7 +18,7 @@ use std::cmp::Ordering; // ANCHOR: types /// A node in the binary tree. #[derive(Debug)] -struct Node { +struct Node { value: T, left: Subtree, right: Subtree, @@ -26,18 +26,18 @@ struct Node { /// A possibly-empty subtree. #[derive(Debug)] -struct Subtree(Option>>); +struct Subtree(Option>>); /// A container storing a set of values, using a binary tree. /// /// If the same value is added multiple times, it is only stored once. #[derive(Debug)] -pub struct BinaryTree { +pub struct BinaryTree { root: Subtree, } // ANCHOR_END: types -impl BinaryTree { +impl BinaryTree { fn new() -> Self { Self { root: Subtree::new(), @@ -57,7 +57,7 @@ impl BinaryTree { } } -impl Subtree { +impl Subtree { fn new() -> Self { Self(None) } @@ -92,7 +92,7 @@ impl Subtree { } } -impl Node { +impl Node { fn new(value: T) -> Self { Self { value,