|
|
@@ -66,11 +66,7 @@ impl Node {
|
|
|
}
|
|
|
|
|
|
pub fn get_character(self: &Node) -> Result<char, &str> {
|
|
|
- if !self.is_leaf() {
|
|
|
- return Err("This node is not a leaf node.");
|
|
|
- }
|
|
|
-
|
|
|
- Ok(self.character.unwrap())
|
|
|
+ self.character.ok_or("This node has no character.")
|
|
|
}
|
|
|
|
|
|
pub fn get_character_code(self: &Node, character: char) -> Result<BitVec, &str> {
|