Skip to content

Commit

Permalink
Rollup merge of rust-lang#24628 - steveklabnik:gh24173, r=alexcrichton
Browse files Browse the repository at this point in the history
Fixes rust-lang#24173 

These docs could all use examples, so for now, let's just remove the bad one, and when I go over this whole module I'll put in better ones.
  • Loading branch information
steveklabnik committed Apr 21, 2015
2 parents 417ff8a + 89ef637 commit 5de4e87
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions src/libcore/cmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,6 @@
//! implement comparison operators. Rust programs may implement `PartialOrd` to overload the `<`,
//! `<=`, `>`, and `>=` operators, and may implement `PartialEq` to overload the `==` and `!=`
//! operators.
//!
//! For example, to define a type with a customized definition for the PartialEq operators, you
//! could do the following:
//!
//! ```
//! # #![feature(core)]
//! struct FuzzyNum {
//! num: i32,
//! }
//!
//! impl PartialEq for FuzzyNum {
//! // Our custom eq allows numbers which are near each other to be equal! :D
//! fn eq(&self, other: &FuzzyNum) -> bool {
//! (self.num - other.num).abs() < 5
//! }
//! }
//!
//! // Now these binary operators will work when applied!
//! assert!(FuzzyNum { num: 37 } == FuzzyNum { num: 34 });
//! assert!(FuzzyNum { num: 25 } != FuzzyNum { num: 57 });
//! ```

#![stable(feature = "rust1", since = "1.0.0")]

Expand Down

0 comments on commit 5de4e87

Please sign in to comment.