diff options
| author | Marvin Löbel <loebel.marvin@gmail.com> | 2013-05-09 13:52:07 +0200 |
|---|---|---|
| committer | Björn Steinbrink <bsteinbr@gmail.com> | 2013-05-14 16:36:24 +0200 |
| commit | 04de8f852c4def51f02eb812f4ecee83d416911b (patch) | |
| tree | bf394aa7ebda0ae70ae70d03f753d6de4388e939 /src/libcore | |
| parent | bdc182cc41c2741edc6fdc4ec09b8522479aab40 (diff) | |
| download | rust-04de8f852c4def51f02eb812f4ecee83d416911b.tar.gz rust-04de8f852c4def51f02eb812f4ecee83d416911b.zip | |
Fix cosmetics for fail!() calls
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/local_data.rs | 4 | ||||
| -rw-r--r-- | src/libcore/num/strconv.rs | 16 | ||||
| -rw-r--r-- | src/libcore/os.rs | 6 | ||||
| -rw-r--r-- | src/libcore/run.rs | 3 | ||||
| -rw-r--r-- | src/libcore/str.rs | 2 |
5 files changed, 13 insertions, 18 deletions
diff --git a/src/libcore/local_data.rs b/src/libcore/local_data.rs index a440a7f6410..2cbf8b9f05e 100644 --- a/src/libcore/local_data.rs +++ b/src/libcore/local_data.rs @@ -133,13 +133,13 @@ fn test_tls_modify() { local_data_modify(my_key, |data| { match data { Some(@ref val) => fail!("unwelcome value: %s", *val), - None => Some(@~"first data") + None => Some(@~"first data") } }); local_data_modify(my_key, |data| { match data { Some(@~"first data") => Some(@~"next data"), - Some(@ref val) => fail!("wrong value: %s", *val), + Some(@ref val) => fail!("wrong value: %s", *val), None => fail!("missing value") } }); diff --git a/src/libcore/num/strconv.rs b/src/libcore/num/strconv.rs index 044b0d4a36c..1d65b84b7ce 100644 --- a/src/libcore/num/strconv.rs +++ b/src/libcore/num/strconv.rs @@ -178,11 +178,9 @@ pub fn to_str_bytes_common<T:NumCast+Zero+One+Eq+Ord+NumStrConv+Copy+ num: &T, radix: uint, negative_zero: bool, sign: SignFormat, digits: SignificantDigits) -> (~[u8], bool) { if (radix as int) < 2 { - fail!("to_str_bytes_common: radix %? to low, \ - must lie in the range [2, 36]", radix); + fail!("to_str_bytes_common: radix %? to low, must lie in the range [2, 36]", radix); } else if radix as int > 36 { - fail!("to_str_bytes_common: radix %? to high, \ - must lie in the range [2, 36]", radix); + fail!("to_str_bytes_common: radix %? to high, must lie in the range [2, 36]", radix); } let _0: T = Zero::zero(); @@ -445,19 +443,19 @@ pub fn from_str_bytes_common<T:NumCast+Zero+One+Eq+Ord+Copy+Div<T,T>+ match exponent { ExpDec if radix >= DIGIT_E_RADIX // decimal exponent 'e' => fail!("from_str_bytes_common: radix %? incompatible with \ - use of 'e' as decimal exponent", radix), + use of 'e' as decimal exponent", radix), ExpBin if radix >= DIGIT_P_RADIX // binary exponent 'p' => fail!("from_str_bytes_common: radix %? incompatible with \ - use of 'p' as binary exponent", radix), + use of 'p' as binary exponent", radix), _ if special && radix >= DIGIT_I_RADIX // first digit of 'inf' => fail!("from_str_bytes_common: radix %? incompatible with \ - special values 'inf' and 'NaN'", radix), + special values 'inf' and 'NaN'", radix), _ if (radix as int) < 2 => fail!("from_str_bytes_common: radix %? to low, \ - must lie in the range [2, 36]", radix), + must lie in the range [2, 36]", radix), _ if (radix as int) > 36 => fail!("from_str_bytes_common: radix %? to high, \ - must lie in the range [2, 36]", radix), + must lie in the range [2, 36]", radix), _ => () } diff --git a/src/libcore/os.rs b/src/libcore/os.rs index c512372d7c6..9129b33fff5 100644 --- a/src/libcore/os.rs +++ b/src/libcore/os.rs @@ -178,8 +178,7 @@ pub fn env() -> ~[(~str,~str)] { }; let ch = GetEnvironmentStringsA(); if (ch as uint == 0) { - fail!("os::env() failure getting env string from OS: %s", - os::last_os_error()); + fail!("os::env() failure getting env string from OS: %s", os::last_os_error()); } let mut curr_ptr: uint = ch as uint; let mut result = ~[]; @@ -201,8 +200,7 @@ pub fn env() -> ~[(~str,~str)] { } let environ = rust_env_pairs(); if (environ as uint == 0) { - fail!("os::env() failure getting env string from OS: %s", - os::last_os_error()); + fail!("os::env() failure getting env string from OS: %s", os::last_os_error()); } let mut result = ~[]; ptr::array_each(environ, |e| { diff --git a/src/libcore/run.rs b/src/libcore/run.rs index c0c1698ebc0..c84e920a172 100644 --- a/src/libcore/run.rs +++ b/src/libcore/run.rs @@ -646,8 +646,7 @@ pub fn program_output(prog: &str, args: &[~str]) -> ProgramOutput { errs = s; } (n, _) => { - fail!("program_output received an unexpected file \ - number: %u", n); + fail!("program_output received an unexpected file number: %u", n); } }; count -= 1; diff --git a/src/libcore/str.rs b/src/libcore/str.rs index ce6b7e495ee..ce9db796b67 100644 --- a/src/libcore/str.rs +++ b/src/libcore/str.rs @@ -1052,7 +1052,7 @@ pub fn _each_split_within<'a>(ss: &'a str, (B, Cr, UnderLim) => { B } (B, Cr, OverLim) if (i - last_start + 1) > lim => fail!("word starting with %? longer than limit!", - self::slice(ss, last_start, i + 1)), + self::slice(ss, last_start, i + 1)), (B, Cr, OverLim) => { slice(); slice_start = last_start; B } (B, Ws, UnderLim) => { last_end = i; C } (B, Ws, OverLim) => { last_end = i; slice(); A } |
