diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-09-27 17:02:31 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-09-30 23:21:18 -0700 |
| commit | a8ba31dbf3e7d80a069bc486a35eff8357282b68 (patch) | |
| tree | 8a00829d527c443d16988b98cd7c97f1d3d4dac6 /src/libstd/local_data.rs | |
| parent | aaf6cc3a841095a95a9c74a6a2a3709dffd7a4e9 (diff) | |
std: Remove usage of fmt!
Diffstat (limited to 'src/libstd/local_data.rs')
| -rw-r--r-- | src/libstd/local_data.rs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/libstd/local_data.rs b/src/libstd/local_data.rs index 5058821d456..54c77e2d9f6 100644 --- a/src/libstd/local_data.rs +++ b/src/libstd/local_data.rs @@ -143,8 +143,8 @@ pub fn pop<T: 'static>(key: Key<T>) -> Option<T> { match *entry { Some((k, _, loan)) if k == key_value => { if loan != NoLoan { - fail!("TLS value cannot be removed because it is currently \ - borrowed as %s", loan.describe()); + fail2!("TLS value cannot be removed because it is currently \ + borrowed as {}", loan.describe()); } // Move the data out of the `entry` slot via util::replace. // This is guaranteed to succeed because we already matched @@ -240,8 +240,8 @@ fn get_with<T: 'static, U>(key: Key<T>, } (ImmLoan, ImmLoan) => {} (want, cur) => { - fail!("TLS slot cannot be borrowed as %s because \ - it is already borrowed as %s", + fail2!("TLS slot cannot be borrowed as {} because \ + it is already borrowed as {}", want.describe(), cur.describe()); } } @@ -304,8 +304,8 @@ pub fn set<T: 'static>(key: Key<T>, data: T) { match *entry { Some((ekey, _, loan)) if key == ekey => { if loan != NoLoan { - fail!("TLS value cannot be overwritten because it is - already borrowed as %s", loan.describe()) + fail2!("TLS value cannot be overwritten because it is + already borrowed as {}", loan.describe()) } true } @@ -388,15 +388,15 @@ mod tests { static my_key: Key<@~str> = &Key; modify(my_key, |data| { match data { - Some(@ref val) => fail!("unwelcome value: %s", *val), + Some(@ref val) => fail2!("unwelcome value: {}", *val), None => Some(@~"first data") } }); modify(my_key, |data| { match data { Some(@~"first data") => Some(@~"next data"), - Some(@ref val) => fail!("wrong value: %s", *val), - None => fail!("missing value") + Some(@ref val) => fail2!("wrong value: {}", *val), + None => fail2!("missing value") } }); assert!(*(pop(my_key).unwrap()) == ~"next data"); @@ -456,11 +456,11 @@ mod tests { set(str_key, @~"string data"); set(box_key, @@()); set(int_key, @42); - fail!(); + fail2!(); } // Not quite nondeterministic. set(int_key, @31337); - fail!(); + fail2!(); } #[test] |
