Skip to content

Commit 9c8b0c6

Browse files
killerswanbrson
authored andcommitted
Demode treemap.rs
1 parent 100368a commit 9c8b0c6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/libstd/treemap.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
* very naive algorithm, but it will probably be updated to be a
66
* red-black tree or something else.
77
*/
8+
#[forbid(deprecated_mode)];
9+
#[forbid(deprecated_pattern)];
810

911
use core::cmp::{Eq, Ord};
1012
use core::option::{Some, None};
@@ -30,7 +32,7 @@ enum tree_node<K, V> = {
3032
fn treemap<K, V>() -> treemap<K, V> { @mut None }
3133

3234
/// Insert a value into the map
33-
fn insert<K: copy Eq Ord, V: copy>(m: &mut tree_edge<K, V>, k: K, v: V) {
35+
fn insert<K: copy Eq Ord, V: copy>(m: &mut tree_edge<K, V>, +k: K, +v: V) {
3436
match copy *m {
3537
None => {
3638
*m = Some(@tree_node({key: k,
@@ -52,7 +54,7 @@ fn insert<K: copy Eq Ord, V: copy>(m: &mut tree_edge<K, V>, k: K, v: V) {
5254
}
5355

5456
/// Find a value based on the key
55-
fn find<K: copy Eq Ord, V: copy>(m: &const tree_edge<K, V>, k: K)
57+
fn find<K: copy Eq Ord, V: copy>(m: &const tree_edge<K, V>, +k: K)
5658
-> Option<V> {
5759
match copy *m {
5860
None => None,
@@ -124,7 +126,7 @@ mod tests {
124126
insert(m, 1, ());
125127

126128
let n = @mut 0;
127-
fn t(n: @mut int, &&k: int, &&_v: ()) {
129+
fn t(n: @mut int, +k: int, +_v: ()) {
128130
assert (*n == k); *n += 1;
129131
}
130132
traverse(m, |x,y| t(n, x, y));

0 commit comments

Comments
 (0)