core/std: an unending parade of minor tweaks due to renaming Option et al

This commit is contained in:
Jeff Olson
2012-08-27 23:26:31 -07:00
committed by Brian Anderson
parent 9ee7b31414
commit 6bdda1e0de

View File

@@ -1557,7 +1557,7 @@ unsafe fn local_set<T: Owned>(
} }
None => { None => {
// Find an empty slot. If not, grow the vector. // Find an empty slot. If not, grow the vector.
match (*map).position(|x| x.is_None()) { match (*map).position(|x| x.is_none()) {
Some(empty_index) => (*map).set_elt(empty_index, new_entry), Some(empty_index) => (*map).set_elt(empty_index, new_entry),
None => (*map).push(new_entry) None => (*map).push(new_entry)
} }
@@ -2280,7 +2280,7 @@ fn test_tls_multitask() unsafe {
fn my_key(+_x: @~str) { } fn my_key(+_x: @~str) { }
local_data_set(my_key, @~"parent data"); local_data_set(my_key, @~"parent data");
do task::spawn unsafe { do task::spawn unsafe {
assert local_data_get(my_key).is_None(); // TLS shouldn't carry over. assert local_data_get(my_key).is_none(); // TLS shouldn't carry over.
local_data_set(my_key, @~"child data"); local_data_set(my_key, @~"child data");
assert *(local_data_get(my_key).get()) == ~"child data"; assert *(local_data_get(my_key).get()) == ~"child data";
// should be cleaned up for us // should be cleaned up for us
@@ -2305,7 +2305,7 @@ fn test_tls_pop() unsafe {
local_data_set(my_key, @~"weasel"); local_data_set(my_key, @~"weasel");
assert *(local_data_pop(my_key).get()) == ~"weasel"; assert *(local_data_pop(my_key).get()) == ~"weasel";
// Pop must remove the data from the map. // Pop must remove the data from the map.
assert local_data_pop(my_key).is_None(); assert local_data_pop(my_key).is_none();
} }
#[test] #[test]