about summary refs log tree commit diff
path: root/src/libstd/cmp.rs
AgeCommit message (Collapse)AuthorLines
2014-02-13Removed num::OrderableMichael Darakananda-0/+2
2014-01-09Remove ApproxEq and assert_approx_eq!Brendan Zabarauskas-7/+0
This trait seems to stray too far from the mandate of a standard library as implementations may vary between use cases.
2013-08-30Now inline default 'ne' methodsEric Martin-0/+2
2013-08-09Remove redundant Ord method impls.OGINO Masanori-6/+3
Basically, generic containers should not use the default methods since a type of elements may not guarantees total order. str could use them since u8's Ord guarantees total order. Floating point numbers are also broken with the default methods because of NaN. Thanks for @thestinger. Timespec also guarantees total order AIUI. I'm unsure whether extra::semver::Identifier does so I left it alone. Proof needed. Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
2013-08-04syntax: make #[deriving(TotalOrd)] lazy.Huon Wilson-1/+0
Previously it would call: f(sf1.cmp(&of1), f(sf2.cmp(&of2), ...)) (where s/of1 = 'self/other field 1', and f was std::cmp::lexical_ordering) This meant that every .cmp subcall got evaluated when calling a derived TotalOrd.cmp. This corrects this to use let test = sf1.cmp(&of1); if test == Equal { let test = sf2.cmp(&of2); if test == Equal { // ... } else { test } } else { test } This gives a lexical ordering by short-circuiting on the first comparison that is not Equal.
2013-08-03remove obsolete `foreach` keywordDaniel Micay-1/+1
this has been replaced by `for`
2013-08-03make `for` parse as `foreach` doesDaniel Micay-1/+3
Closes #6997
2013-07-25auto merge of #8030 : thestinger/rust/iterator, r=huonwbors-1/+0
2013-07-24rm default method lintDaniel Micay-1/+0
default methods are enabled by default, so there's not much point in keeping around a lint to report them as being experimental
2013-07-23Fix some impls such that all supertraits are actually implemented.Michael Sullivan-0/+6
2013-07-15cmp: Use default methods in trait Eq, require only Eq::eqblake2-ppc-2/+4
2013-07-13cmp: Use default methods in trait Ord, only require Ord::ltblake2-ppc-8/+9
It will be simpler to implement only one method for Ord, while we also allow implementing all four Ord methods for semantics or performance reasons. We only supply three default methods (and not four), because don't have any nice error reporting for the case where at least one method must be implemented, but it's arbitrary which.
2013-06-18replace #[inline(always)] with #[inline]. r=burningtree.Graydon Hoare-10/+10
2013-06-09cmp: remove duplicate free functionsDaniel Micay-30/+0
2013-05-30Require documentation by default for libstdAlex Crichton-0/+2
Adds documentation for various things that I understand. Adds #[allow(missing_doc)] for lots of things that I don't understand.
2013-05-22libstd: Rename libcore to libstd and libstd to libextra; update makefiles.Patrick Walton-0/+265
This only changes the directory names; it does not change the "real" metadata names.
2013-05-06Move FuzzyEq trait into core::cmp and rename it to 'ApproxEq'Brendan Zabarauskas-102/+0
2013-05-02mod items need to be marked with `cfg(test)` not `test`.Felix S. Klock II-1/+1
2013-03-29librustc: Remove `fail_unless!`Patrick Walton-10/+10
2013-03-22librustc: Remove the `const` declaration form everywherePatrick Walton-1/+1
2013-03-22libstd: Remove all uses of `pure` from libstd. rs=depurePatrick Walton-10/+10
2013-03-07librustc: Convert all uses of `assert` over to `fail_unless!`Patrick Walton-10/+10
2013-02-14librustc: Replace `impl Type : Trait` with `impl Trait for Type`. ↵Patrick Walton-4/+4
rs=implflipping
2013-02-07auto merge of #4831 : bjz/rust/incoming, r=pcwaltonbors-9/+46
This is useful for comparing more complex types that include floats.
2013-02-07Make ~fn non-copyable, make &fn copyable, split barefn/closure types,Niko Matsakis-1/+0
correct handling of moves for struct-record update. Part of #3678. Fixes #2828, #3904, #4719.
2013-02-07Add type parameter for epsilon valueBrendan Zabarauskas-5/+42
2013-02-07Convert fuzzy_epsilon constant to upper case and make publicBrendan Zabarauskas-4/+4
2013-01-30librustc: Change `self` as a type to `Self` everywhere. r=brsonPatrick Walton-2/+2
2013-01-30rustc: make integral type inference transactional, close #3211, close #4401, ↵Graydon Hoare-3/+3
close #3398.
2013-01-29Merge pull request #4676 from thestinger/fuzzyTim Chevalier-3/+3
fix FuzzyEq
2013-01-29fix FuzzyEqDaniel Micay-3/+3
2013-01-29Fix licenseck to allow 2012-2013 as the year rangeTim Chevalier-2/+2
2013-01-29implement fuzzy_eq with fuzzy_eq_epsDaniel Micay-4/+4
2013-01-28add a FuzzyEq method that accepts an epsilon valueDaniel Micay-1/+20
2013-01-28update FuzzyEq to explicit selfDaniel Micay-11/+10
2013-01-28fix std::cmp docstringDaniel Micay-1/+1
2012-12-27librustc: Terminate name searches at the nearest module scope for paths that ↵Patrick Walton-0/+4
contain at least two components. r=graydon
2012-12-03Update license, add license boilerplate to most files. Remainder will follow.Graydon Hoare-0/+10
2012-09-28std: Eliminate deprecated patternsBrian Anderson-1/+0
2012-09-27De-export std::{base64,cmp,par}. Part of #3583.Graydon Hoare-1/+1
2012-09-02std: warn(non_camel_case_types) everywhere. still some exceptionsBrian Anderson-1/+0
2012-08-31Remove deprecated modes from FuzzyEq in cmp.rsKevin Cantu-10/+12
This commit may require changes to the following Servo files: * rust-geom/matrix.rs * servo/platform/osmain.rs * rust-layers/layers.rs * rust-geom/matrix.rs
2012-08-28CamelCasify lots of stdBen Striegel-4/+5
2012-08-08Convert impls to new syntaxBrian Anderson-3/+3
2012-08-01Convert ret to returnBrian Anderson-3/+3
2012-07-26core: Mark a bunch of numeric functions as purePatrick Walton-5/+5
2012-07-04convert doc-attributes to doc-comments using ↵Gareth Daniel Smith-1/+1
./src/etc/sugarise-doc-comments.py (and manually tweaking) - for issue #2498
2012-06-07std: Implement a fuzzy-equal interfacePatrick Walton-0/+33