File tree 1 file changed +25
-0
lines changed
1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ A quick summary:
19
19
Implementations of the following traits:
20
20
21
21
* `FromStr`
22
+ * `ToStr`
23
+ * `Not`
22
24
* `Ord`
23
25
* `TotalOrd`
24
26
* `Eq`
@@ -36,6 +38,8 @@ Finally, some inquries into the nature of truth: `is_true` and `is_false`.
36
38
37
39
#[ cfg( not( test) ) ]
38
40
use cmp:: { Eq , Ord , TotalOrd , Ordering } ;
41
+ #[ cfg( not( test) ) ]
42
+ use ops:: Not ;
39
43
use option:: { None , Option , Some } ;
40
44
use from_str:: FromStr ;
41
45
use to_str:: ToStr ;
@@ -254,6 +258,27 @@ pub fn all_values(blk: &fn(v: bool)) {
254
258
#[ inline]
255
259
pub fn to_bit ( v : bool ) -> u8 { if v { 1u8 } else { 0u8 } }
256
260
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
+
257
282
#[ cfg( not( test) ) ]
258
283
impl Ord for bool {
259
284
#[ inline]
You can’t perform that action at this time.
0 commit comments