Skip to content

Commit 4e3bcd9

Browse files
brendanzabthestinger
authored andcommitted
---
yaml --- r: 64158 b: refs/heads/snap-stage3 c: 763d846 h: refs/heads/master v: v3
1 parent 5c50d17 commit 4e3bcd9

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: f2bd4416fa3549f962c8ffdd6474cf4bf0d21eca
4+
refs/heads/snap-stage3: 763d846dd3db43751eba5b53b6923b8355581063
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/libstd/bool.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ A quick summary:
1919
Implementations of the following traits:
2020
2121
* `FromStr`
22+
* `ToStr`
23+
* `Not`
2224
* `Ord`
2325
* `TotalOrd`
2426
* `Eq`
@@ -36,6 +38,8 @@ Finally, some inquries into the nature of truth: `is_true` and `is_false`.
3638

3739
#[cfg(not(test))]
3840
use cmp::{Eq, Ord, TotalOrd, Ordering};
41+
#[cfg(not(test))]
42+
use ops::Not;
3943
use option::{None, Option, Some};
4044
use from_str::FromStr;
4145
use to_str::ToStr;
@@ -254,6 +258,27 @@ pub fn all_values(blk: &fn(v: bool)) {
254258
#[inline]
255259
pub fn to_bit(v: bool) -> u8 { if v { 1u8 } else { 0u8 } }
256260

261+
/**
262+
* The logical complement of a boolean value.
263+
*
264+
* # Examples
265+
*
266+
* ~~~rust
267+
* rusti> !true
268+
* false
269+
* ~~~
270+
*
271+
* ~~~rust
272+
* rusti> !false
273+
* true
274+
* ~~~
275+
*/
276+
#[cfg(not(test))]
277+
impl Not<bool> for bool {
278+
#[inline]
279+
fn not(&self) -> bool { !*self }
280+
}
281+
257282
#[cfg(not(test))]
258283
impl Ord for bool {
259284
#[inline]

0 commit comments

Comments
 (0)