Skip to content

Commit 91e955e

Browse files
committed
---
yaml --- r: 114144 b: refs/heads/master c: 1ef8246 h: refs/heads/master v: v3
1 parent 0400f43 commit 91e955e

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
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: dfe021625adc0526385d776d3a7f495c437e2c7e
2+
refs/heads/master: 1ef82469464ec733dd7cbd19c9f6e7c6f9d0e7b1
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: ec0258a381b88b5574e3f8ce72ae553ac3a574b7
55
refs/heads/try: 7c6c492fb2af9a85f21ff952942df3523b22fd17

trunk/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)