diff options
| author | Björn Steinbrink <bsteinbr@gmail.com> | 2013-05-06 00:18:51 +0200 |
|---|---|---|
| committer | Björn Steinbrink <bsteinbr@gmail.com> | 2013-05-14 16:36:23 +0200 |
| commit | bdc182cc41c2741edc6fdc4ec09b8522479aab40 (patch) | |
| tree | e4d26bbc1b47702ef46cd01bbaa5b5dad8633416 /src/libstd/sync.rs | |
| parent | 84745b483f322671f894b9e8d0a462c46275a9d3 (diff) | |
| download | rust-bdc182cc41c2741edc6fdc4ec09b8522479aab40.tar.gz rust-bdc182cc41c2741edc6fdc4ec09b8522479aab40.zip | |
Use static string with fail!() and remove fail!(fmt!())
fail!() used to require owned strings but can handle static strings now. Also, it can pass its arguments to fmt!() on its own, no need for the caller to call fmt!() itself.
Diffstat (limited to 'src/libstd/sync.rs')
| -rw-r--r-- | src/libstd/sync.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libstd/sync.rs b/src/libstd/sync.rs index 108f24d60dc..023fc18cdc1 100644 --- a/src/libstd/sync.rs +++ b/src/libstd/sync.rs @@ -329,11 +329,11 @@ fn check_cvar_bounds<U>(out_of_bounds: Option<uint>, id: uint, act: &str, blk: &fn() -> U) -> U { match out_of_bounds { Some(0) => - fail!(fmt!("%s with illegal ID %u - this lock has no condvars!", - act, id)), + fail!("%s with illegal ID %u - this lock has no condvars!", + act, id), Some(length) => - fail!(fmt!("%s with illegal ID %u - ID must be less than %u", - act, id, length)), + fail!("%s with illegal ID %u - ID must be less than %u", + act, id, length), None => blk() } } @@ -578,7 +578,7 @@ pub impl RWlock { token: RWlockWriteMode<'a>) -> RWlockReadMode<'a> { if !ptr::ref_eq(self, token.lock) { - fail!(~"Can't downgrade() with a different rwlock's write_mode!"); + fail!("Can't downgrade() with a different rwlock's write_mode!"); } unsafe { do task::unkillable { |
