Skip to content

Commit b06599a

Browse files
committed
Demode fun_treemap.rs
1 parent bf430b7 commit b06599a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/libstd/fun_treemap.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#[deny(non_camel_case_types)];
2+
#[forbid(deprecated_mode)];
3+
#[forbid(deprecated_pattern)];
24

35
/*!
46
* A functional key,value store that works on anything.
@@ -32,8 +34,8 @@ enum TreeNode<K, V> {
3234
fn init<K, V>() -> Treemap<K, V> { @Empty }
3335

3436
/// Insert a value into the map
35-
fn insert<K: copy Eq Ord, V: copy>(m: Treemap<K, V>, k: K, v: V)
36-
-> Treemap<K, V> {
37+
fn insert<K: copy Eq Ord, V: copy>(m: Treemap<K, V>, +k: K, +v: V)
38+
-> Treemap<K, V> {
3739
@match m {
3840
@Empty => Node(@k, @v, @Empty, @Empty),
3941
@Node(@kk, vv, left, right) => {
@@ -47,7 +49,7 @@ fn insert<K: copy Eq Ord, V: copy>(m: Treemap<K, V>, k: K, v: V)
4749
}
4850

4951
/// Find a value based on the key
50-
fn find<K: Eq Ord, V: copy>(m: Treemap<K, V>, k: K) -> Option<V> {
52+
fn find<K: Eq Ord, V: copy>(m: Treemap<K, V>, +k: K) -> Option<V> {
5153
match *m {
5254
Empty => None,
5355
Node(@kk, @v, left, right) => {

0 commit comments

Comments
 (0)