You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
structSolution {} // Assigning an empty struct to make a solution impl block.
38
79
39
-
- Macros (for Trees and Linked Lists)
80
+
usestd::{cell::RefCell, rc::Rc};
81
+
implSolution {
82
+
pubfnyour_leetcode_fn() {}
83
+
}
84
+
85
+
#[cfg(test)]
86
+
modtests {
87
+
#[test]
88
+
fntests() {
89
+
// . . .
90
+
}
91
+
}
92
+
93
+
fnmain() ->Result<()> {
94
+
// This is the very cumbersome manual way of writing your ListNode structs.
95
+
letsome_list=ListNode {
96
+
val:1,
97
+
next:Some(Box::new(ListNode {
98
+
val:2,
99
+
next:Some(Box::new(ListNode::new(3))),
100
+
})),
101
+
};
102
+
// And this is the easier way:
103
+
letanother_list=list_node!(1, 2, 3);
104
+
105
+
assert_eq!(some_list, another_list);
106
+
107
+
Ok(())
108
+
}
109
+
```
110
+
111
+
## LICENSE
112
+
113
+
The project is licensed under the MIT license.
114
+
115
+
## Extra notes
116
+
117
+
---
40
118
41
119
Additional code templating can be found in [This template file](https://github.com/1Kill2Steal/leetcode-trees-rs/blob/main/solutions/lc0_general_nodes_template/src/main.rs).
120
+
42
121
It's located at: `solutions/lc0_general_nodes_template/src/main.rs`
122
+
123
+
---
124
+
125
+
Additional documentation can be found in [docs.rs](https://docs.rs/leetcode-trees-rs/latest/leetcode_trees_rs/).
0 commit comments