Skip to content

Commit 1ef8246

Browse files
committed
libcollections: Remove most uses of ~str from libcollections
1 parent dfe0216 commit 1ef8246

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

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)