]> git.lizzy.rs Git - rust.git/commitdiff
core: Remove bool::to_bit
authorBrian Anderson <banderson@mozilla.com>
Mon, 23 Jun 2014 22:58:01 +0000 (22:58 +0000)
committerAlex Crichton <alex@alexcrichton.com>
Wed, 25 Jun 2014 00:22:59 +0000 (17:22 -0700)
This is an unused one-liner.

src/libcore/bool.rs

index 146f29dd9f1da64716a765223002069ce0dfd2e2..c92fe8f7474ffb8a60a5c33b782457f6e350ca9f 100644 (file)
@@ -8,33 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-//! Operations on boolean values (`bool` type)
-//!
-//! A `to_bit` conversion function.
+//! The boolean type
 
 #![doc(primitive = "bool")]
 
-use num::{Int, one, zero};
-
-/////////////////////////////////////////////////////////////////////////////
-// Freestanding functions
-/////////////////////////////////////////////////////////////////////////////
-
-/// Convert a `bool` to an integer.
-///
-/// # Examples
-///
-/// ```rust
-/// use std::bool;
-///
-/// assert_eq!(bool::to_bit::<u8>(true), 1u8);
-/// assert_eq!(bool::to_bit::<u8>(false), 0u8);
-/// ```
-#[inline]
-pub fn to_bit<N: Int>(p: bool) -> N {
-    if p { one() } else { zero() }
-}
-
 #[cfg(test)]
 mod tests {
     use realstd::prelude::*;