parent
f132401a0b
commit
f73bb2bfe6
@ -24,6 +24,7 @@ Implementations of the following traits:
|
||||
* `Ord`
|
||||
* `TotalOrd`
|
||||
* `Eq`
|
||||
* `Zero`
|
||||
|
||||
## Various functions to compare `bool`s
|
||||
|
||||
@ -36,14 +37,14 @@ Finally, some inquries into the nature of truth: `is_true` and `is_false`.
|
||||
|
||||
*/
|
||||
|
||||
#[cfg(not(test))]
|
||||
use cmp::{Eq, Ord, TotalOrd, Ordering};
|
||||
#[cfg(not(test))]
|
||||
use ops::Not;
|
||||
use option::{None, Option, Some};
|
||||
use from_str::FromStr;
|
||||
use to_str::ToStr;
|
||||
|
||||
#[cfg(not(test))] use cmp::{Eq, Ord, TotalOrd, Ordering};
|
||||
#[cfg(not(test))] use ops::Not;
|
||||
#[cfg(not(test))] use num::Zero;
|
||||
|
||||
/**
|
||||
* Negation of a boolean value.
|
||||
*
|
||||
@ -330,6 +331,12 @@ impl Eq for bool {
|
||||
fn ne(&self, other: &bool) -> bool { (*self) != (*other) }
|
||||
}
|
||||
|
||||
#[cfg(not(test))]
|
||||
impl Zero for bool {
|
||||
fn zero() -> bool { false }
|
||||
fn is_zero(&self) -> bool { *self == false }
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
@ -33,6 +33,7 @@ struct Lots {
|
||||
g: (f32, char),
|
||||
h: ~[util::NonCopyable],
|
||||
i: @mut (int, int),
|
||||
j: bool,
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
Loading…
Reference in New Issue
Block a user