about summary refs log tree commit diff
path: root/src/libstd/char.rs
diff options
context:
space:
mode:
authorBrendan Zabarauskas <bjzaba@yahoo.com.au>2014-01-18 17:08:23 +1100
committerBrendan Zabarauskas <bjzaba@yahoo.com.au>2014-01-20 18:09:46 +1100
commitcf56624a4ad7703c8f3fc327b8c385da0a803ea5 (patch)
tree0a46f95db2c26f4beb50f7785a82f46348ff9083 /src/libstd/char.rs
parent764f2cb6f3517869e31fc7b93ff11dd840db8d30 (diff)
downloadrust-cf56624a4ad7703c8f3fc327b8c385da0a803ea5.tar.gz
rust-cf56624a4ad7703c8f3fc327b8c385da0a803ea5.zip
Add operator trait constraints to std::num::{Zero, One} and document their appropriate use
Zero and One have precise definitions in mathematics. Documentation has been added to describe the appropriate uses for these traits and the laws that they should satisfy.

For more information regarding these identities, see the following wikipedia pages:

- http://wikipedia.org/wiki/Additive_identity
- http://wikipedia.org/wiki/Multiplicative_identity
Diffstat (limited to 'src/libstd/char.rs')
-rw-r--r--src/libstd/char.rs10
1 files changed, 0 insertions, 10 deletions
diff --git a/src/libstd/char.rs b/src/libstd/char.rs
index 4e9c72de618..71a297d7176 100644
--- a/src/libstd/char.rs
+++ b/src/libstd/char.rs
@@ -22,7 +22,6 @@ use str;
 
 #[cfg(not(test))] use cmp::{Eq, Ord};
 #[cfg(not(test))] use default::Default;
-#[cfg(not(test))] use num::Zero;
 
 // UTF-8 ranges and tags for encoding characters
 static TAG_CONT: uint = 128u;
@@ -449,15 +448,6 @@ impl Default for char {
     fn default() -> char { '\x00' }
 }
 
-#[cfg(not(test))]
-impl Zero for char {
-    #[inline]
-    fn zero() -> char { '\x00' }
-
-    #[inline]
-    fn is_zero(&self) -> bool { *self == '\x00' }
-}
-
 #[test]
 fn test_is_lowercase() {
     assert!('a'.is_lowercase());