Skip to content

Commit cfd7a70

Browse files
committed
---
yaml --- r: 151677 b: refs/heads/try2 c: 1ef8246 h: refs/heads/master i: 151675: 30bf919 v: v3
1 parent 34f0813 commit cfd7a70

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: dfe021625adc0526385d776d3a7f495c437e2c7e
8+
refs/heads/try2: 1ef82469464ec733dd7cbd19c9f6e7c6f9d0e7b1
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libcollections/lru_cache.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -270,23 +270,23 @@ mod tests {
270270

271271
#[test]
272272
fn test_put_update() {
273-
let mut cache: LruCache<~str, Vec<u8>> = LruCache::new(1);
274-
cache.put("1".to_owned(), vec![10, 10]);
275-
cache.put("1".to_owned(), vec![10, 19]);
276-
assert_opt_eq(cache.get(&"1".to_owned()), vec![10, 19]);
273+
let mut cache: LruCache<StrBuf, Vec<u8>> = LruCache::new(1);
274+
cache.put("1".to_strbuf(), vec![10, 10]);
275+
cache.put("1".to_strbuf(), vec![10, 19]);
276+
assert_opt_eq(cache.get(&"1".to_strbuf()), vec![10, 19]);
277277
assert_eq!(cache.len(), 1);
278278
}
279279

280280
#[test]
281281
fn test_expire_lru() {
282-
let mut cache: LruCache<~str, ~str> = LruCache::new(2);
283-
cache.put("foo1".to_owned(), "bar1".to_owned());
284-
cache.put("foo2".to_owned(), "bar2".to_owned());
285-
cache.put("foo3".to_owned(), "bar3".to_owned());
286-
assert!(cache.get(&"foo1".to_owned()).is_none());
287-
cache.put("foo2".to_owned(), "bar2update".to_owned());
288-
cache.put("foo4".to_owned(), "bar4".to_owned());
289-
assert!(cache.get(&"foo3".to_owned()).is_none());
282+
let mut cache: LruCache<StrBuf, StrBuf> = LruCache::new(2);
283+
cache.put("foo1".to_strbuf(), "bar1".to_strbuf());
284+
cache.put("foo2".to_strbuf(), "bar2".to_strbuf());
285+
cache.put("foo3".to_strbuf(), "bar3".to_strbuf());
286+
assert!(cache.get(&"foo1".to_strbuf()).is_none());
287+
cache.put("foo2".to_strbuf(), "bar2update".to_strbuf());
288+
cache.put("foo4".to_strbuf(), "bar4".to_strbuf());
289+
assert!(cache.get(&"foo3".to_strbuf()).is_none());
290290
}
291291

292292
#[test]

0 commit comments

Comments
 (0)