Skip to content
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

refactor(clafrica-lib): Remove unnecessary lifetime uses #7

Merged
merged 1 commit into from
Apr 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions clafrica-lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ pub mod bst {
use std::{cell::RefCell, rc::Rc};

#[derive(Debug)]
pub struct Node<'a> {
neighbors: RefCell<HashMap<char, Rc<Node<'a>>>>,
pub struct Node {
neighbors: RefCell<HashMap<char, Rc<Node>>>,
depth: i32,
value: RefCell<Option<String>>,
}

impl<'a> Default for Node<'a> {
impl Default for Node {
fn default() -> Self {
Self::new(0)
}
}

impl Node<'_> {
impl Node {
/// Initialize a new node.
pub fn new(depth: i32) -> Self {
Self {
Expand Down
2 changes: 1 addition & 1 deletion clafrica/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use clafrica_lib::bst;

struct Cursor<'a> {
stack: Vec<&'a str>,
node: &'a bst::Node<'a>,
node: &'a bst::Node,
}

fn run() {
Expand Down
Loading