Skip to content

Commit ef7de73

Browse files
committed
---
yaml --- r: 42917 b: refs/heads/try c: ed45354 h: refs/heads/master i: 42915: eadba53 v: v3
1 parent 458a339 commit ef7de73

File tree

2 files changed

+3
-81
lines changed

2 files changed

+3
-81
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 19dfec2aaf746535de1521f68421f9980dbf25de
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 2f46b763da2c098913884f101b6d71d69af41b49
5-
refs/heads/try: a06ef7424c1ce55b59351df88888f3b019c99796
5+
refs/heads/try: ed45354a953f43076634d739847c141df69bc81f
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278

branches/try/src/libstd/map.rs

Lines changed: 2 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -28,84 +28,6 @@ pub type Set<K> = HashMap<K, ()>;
2828

2929
pub type HashMap<K, V> = chained::T<K, V>;
3030

31-
pub trait StdMap<K:Eq IterBytes Hash Copy, V: Copy> {
32-
/// Return the number of elements in the map
33-
pure fn size() -> uint;
34-
35-
/**
36-
* Add a value to the map.
37-
*
38-
* If the map already contains a value for the specified key then the
39-
* original value is replaced.
40-
*
41-
* Returns true if the key did not already exist in the map
42-
*/
43-
fn insert(key: K, value: V) -> bool;
44-
45-
/**
46-
* Add a value to the map.
47-
*
48-
* If the map contains a value for the key, use the function
49-
* to set a new value.
50-
*/
51-
fn update_with_key(key: K, newval: V, ff: fn(K, V, V) -> V) -> bool;
52-
53-
/**
54-
* Add a value to the map.
55-
*
56-
* If the map contains a value for the key, use the function to
57-
* set a new value. (Like `update_with_key`, but with a
58-
* function of only values.)
59-
*/
60-
fn update(key: K, newval: V, ff: fn(V, V) -> V) -> bool;
61-
62-
/// Returns true if the map contains a value for the specified key
63-
pure fn contains_key(key: K) -> bool;
64-
65-
/// Returns true if the map contains a value for the specified
66-
/// key, taking the key by reference.
67-
pure fn contains_key_ref(key: &K) -> bool;
68-
69-
/**
70-
* Get the value for the specified key. Fails if the key does not exist in
71-
* the map.
72-
*/
73-
pure fn get(key: K) -> V;
74-
75-
/**
76-
* Get the value for the specified key. If the key does not exist in
77-
* the map then returns none.
78-
*/
79-
pure fn find(key: K) -> Option<V>;
80-
81-
/**
82-
* Remove and return a value from the map. Returns true if the
83-
* key was present in the map, otherwise false.
84-
*/
85-
fn remove(key: K) -> bool;
86-
87-
/// Clear the map, removing all key/value pairs.
88-
fn clear();
89-
90-
/// Iterate over all the key/value pairs in the map by value
91-
pure fn each(fn(key: K, value: V) -> bool);
92-
93-
/// Iterate over all the keys in the map by value
94-
pure fn each_key(fn(key: K) -> bool);
95-
96-
/// Iterate over all the values in the map by value
97-
pure fn each_value(fn(value: V) -> bool);
98-
99-
/// Iterate over all the key/value pairs in the map by reference
100-
pure fn each_ref(fn(key: &K, value: &V) -> bool);
101-
102-
/// Iterate over all the keys in the map by reference
103-
pure fn each_key_ref(fn(key: &K) -> bool);
104-
105-
/// Iterate over all the values in the map by reference
106-
pure fn each_value_ref(fn(value: &V) -> bool);
107-
}
108-
10931
pub mod util {
11032
pub struct Rational {
11133
// : int::positive(*.den);
@@ -124,7 +46,7 @@ pub mod util {
12446
// FIXME (#2344): package this up and export it as a datatype usable for
12547
// external code that doesn't want to pay the cost of a box.
12648
pub mod chained {
127-
use map::{StdMap, util};
49+
use map::util;
12850

12951
use core::io;
13052
use core::ops;
@@ -239,7 +161,7 @@ pub mod chained {
239161
}
240162
}
241163

242-
impl<K:Eq IterBytes Hash Copy, V: Copy> T<K, V>: StdMap<K, V> {
164+
impl<K:Eq IterBytes Hash Copy, V: Copy> T<K, V> {
243165
pure fn size() -> uint { self.count }
244166

245167
pure fn contains_key(k: K) -> bool {

0 commit comments

Comments
 (0)