about summary refs log tree commit diff
path: root/src/libstd/bool.rs
AgeCommit message (Collapse)AuthorLines
2015-03-15Strip all leading/trailing newlinesTamir Duberstein-1/+0
2015-01-23grandfathered -> rust1Brian Anderson-1/+1
2015-01-21Add 'feature' and 'since' to stability attributesBrian Anderson-1/+1
2014-12-18std: Remove public bool,tuple,unit modulesAlex Crichton-0/+15
This commit modifies rustdoc to not require these empty modules to be public in the standard library. The modules still remain as a location to attach documentation to, but the modules themselves are now private (don't have to commit to an API). The documentation for the standard library now shows all of the primitive types on the main index page.
2014-05-07core: Inherit the bool moduleAlex Crichton-302/+0
2014-04-18Replace all ~"" with "".to_owned()Richo Healey-2/+3
2014-02-28std: Change assert_eq!() to use {} instead of {:?}Alex Crichton-4/+4
Formatting via reflection has been a little questionable for some time now, and it's a little unfortunate that one of the standard macros will silently use reflection when you weren't expecting it. This adds small bits of code bloat to libraries, as well as not always being necessary. In light of this information, this commit switches assert_eq!() to using {} in the error message instead of {:?}. In updating existing code, there were a few error cases that I encountered: * It's impossible to define Show for [T, ..N]. I think DST will alleviate this because we can define Show for [T]. * A few types here and there just needed a #[deriving(Show)] * Type parameters needed a Show bound, I often moved this to `assert!(a == b)` * `Path` doesn't implement `Show`, so assert_eq!() cannot be used on two paths. I don't think this is much of a regression though because {:?} on paths looks awful (it's a byte array). Concretely speaking, this shaved 10K off a 656K binary. Not a lot, but sometime significant for smaller binaries.
2014-02-25Remove std::bool::{Bool, all_values}Brendan Zabarauskas-161/+43
These were never used outside of the tests
2014-02-24Remove std::from_str::FromStr from the preludeBrendan Zabarauskas-0/+1
2014-02-23Remove all ToStr impls, add Show implsAlex Crichton-17/+0
This commit changes the ToStr trait to: impl<T: fmt::Show> ToStr for T { fn to_str(&self) -> ~str { format!("{}", *self) } } The ToStr trait has been on the chopping block for quite awhile now, and this is the final nail in its coffin. The trait and the corresponding method are not being removed as part of this commit, but rather any implementations of the `ToStr` trait are being forbidden because of the generic impl. The new way to get the `to_str()` method to work is to implement `fmt::Show`. Formatting into a `&mut Writer` (as `format!` does) is much more efficient than `ToStr` when building up large strings. The `ToStr` trait forces many intermediate allocations to be made while the `fmt::Show` trait allows incremental buildup in the same heap allocated buffer. Additionally, the `fmt::Show` trait is much more extensible in terms of interoperation with other `Writer` instances and in more situations. By design the `ToStr` trait requires at least one allocation whereas the `fmt::Show` trait does not require any allocations. Closes #8242 Closes #9806
2014-01-20Add operator trait constraints to std::num::{Zero, One} and document their ↵Brendan Zabarauskas-7/+0
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
2014-01-11Remove re-exports of std::io::stdio::{print, println} in the prelude.Brendan Zabarauskas-1/+1
The `print!` and `println!` macros are now the preferred method of printing, and so there is no reason to export the `stdio` functions in the prelude. The functions have also been replaced by their macro counterparts in the tutorial and other documentation so that newcomers don't get confused about what they should be using.
2014-01-07stdtest: Fix all leaked trait importsAlex Crichton-4/+1
2013-12-27std: uniform modules titles for docLuca Bruno-1/+1
This commit uniforms the short title of modules provided by libstd, in order to make their roles more explicit when glancing at the index. Signed-off-by: Luca Bruno <lucab@debian.org>
2013-11-26test: Remove non-procedure uses of `do` from compiletest, libstd tests,Patrick Walton-6/+6
compile-fail tests, run-fail tests, and run-pass tests.
2013-11-19libstd: Change all uses of `&fn(A)->B` over to `|A|->B` in libstdPatrick Walton-1/+1
2013-11-03Remove all blocking std::os blocking functionsAlex Crichton-2/+5
This commit moves all thread-blocking I/O functions from the std::os module. Their replacements can be found in either std::rt::io::file or in a hidden "old_os" module inside of native::file. I didn't want to outright delete these functions because they have a lot of special casing learned over time for each OS/platform, and I imagine that these will someday get integrated into a blocking implementation of IoFactory. For now, they're moved to a private module to prevent bitrot and still have tests to ensure that they work. I've also expanded the extensions to a few more methods defined on Path, most of which were previously defined in std::os but now have non-thread-blocking implementations as part of using the current IoFactory. The api of io::file is in flux, but I plan on changing it in the next commit as well. Closes #10057
2013-10-24Cleaned, documented, wrote tests for up std::boolMarvin Löbel-269/+321
Removed unused import warning in std::mem and cleaned it up too Removed is_true and is_false from std::bool Removed freestanding functions in std::bool
2013-09-25rustdoc: Change all code-blocks with a scriptAlex Crichton-54/+54
find src -name '*.rs' | xargs sed -i '' 's/~~~.*{\.rust}/```rust/g' find src -name '*.rs' | xargs sed -i '' 's/ ~~~$/ ```/g' find src -name '*.rs' | xargs sed -i '' 's/^~~~$/ ```/g'
2013-09-12std: Add a bunch of Default implsErick Tryzelaar-0/+7
2013-08-30remove several 'ne' methodsEric Martin-2/+0
2013-08-16doc: correct spelling in documentation.Huon Wilson-1/+1
2013-08-09Remove redundant Ord method impls.OGINO Masanori-6/+0
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-07-24Implement std::num::Zero for boolBirunthan Mohanathas-4/+11
Closes #8024.
2013-07-09Impl Not for boolBrendan Zabarauskas-0/+25
2013-07-01Small documentation changesSteven Fackler-0/+1
I'm leaving the Sized kind undocumented since it isn't fully implemented yet.
2013-06-18replace #[inline(always)] with #[inline]. r=burningtree.Graydon Hoare-9/+9
2013-05-31bool: rm functions duplicating methodsDaniel Micay-45/+38
2013-05-27syntax highlight code examples in docstringsDaniel Micay-13/+50
2013-05-27Fix docs to use std instead of core.Steve Klabnik-20/+20
When I submitted #6748 yesterday, I used the old name.
2013-05-26Add documentation for libstd/bool.rs.Steve Klabnik-19/+194
There was some before, but now we have a big header, as well as lots of individual bits of documentation.
2013-05-22libstd: Rename libcore to libstd and libstd to libextra; update makefiles.Patrick Walton-0/+153
This only changes the directory names; it does not change the "real" metadata names.
2011-12-14Remove some duplicated unused parts of std now that they're present in core.Graydon Hoare-134/+0
2011-12-06Establish 'core' library separate from 'std'.Graydon Hoare-0/+134