about summary refs log tree commit diff
path: root/src/libstd/to_str.rs
AgeCommit message (Collapse)AuthorLines
2014-07-21Rename to_str to to_stringSteven Fackler-66/+0
Closes #15796. [breaking-change]
2014-07-08std: Rename the `ToStr` trait to `ToString`, and `to_str` to `to_string`.Richo Healey-18/+18
[breaking-change]
2014-06-30libstd: set baseline stability levels.Aaron Turon-0/+2
Earlier commits have established a baseline of `experimental` stability for all crates under the facade (so their contents are considered experimental within libstd). Since `experimental` is `allow` by default, we should use the same baseline stability for libstd itself. This commit adds `experimental` tags to all of the modules defined in `std`, and `unstable` to `std` itself.
2014-06-24librustc: Remove the fallback to `int` from typechecking.Niko Matsakis-3/+3
This breaks a fair amount of code. The typical patterns are: * `for _ in range(0, 10)`: change to `for _ in range(0u, 10)`; * `println!("{}", 3)`: change to `println!("{}", 3i)`; * `[1, 2, 3].len()`: change to `[1i, 2, 3].len()`. RFC #30. Closes #6023. [breaking-change]
2014-06-11rustc: Remove ~[T] from the languageAlex Crichton-5/+5
The following features have been removed * box [a, b, c] * ~[a, b, c] * box [a, ..N] * ~[a, ..N] * ~[T] (as a type) * deprecated_owned_vector lint All users of ~[T] should move to using Vec<T> instead.
2014-05-28std: Remove format_strbuf!()Alex Crichton-1/+1
This was only ever a transitionary macro.
2014-05-27std: Rename strbuf operations to stringRicho Healey-12/+12
[breaking-change]
2014-05-24core: rename strbuf::StrBuf to string::StringRicho Healey-4/+4
[breaking-change]
2014-05-22libstd: Remove `~str` from all `libstd` modules except `fmt` and `str`.Patrick Walton-15/+18
2014-05-07core: Inherit possible string functionalityAlex Crichton-1/+1
This moves as much allocation as possible from teh std::str module into core::str. This includes essentially all non-allocating functionality, mostly iterators and slicing and such. This primarily splits the Str trait into only having the as_slice() method, adding a new StrAllocating trait to std::str which contains the relevant new allocation methods. This is a breaking change if any of the methods of "trait Str" were overriden. The old functionality can be restored by implementing both the Str and StrAllocating traits. [breaking-change]
2014-05-02Replace most ~exprs with 'box'. #11779Brian Anderson-4/+4
2014-04-18Replace all ~"" with "".to_owned()Richo Healey-12/+13
2014-02-23Remove all ToStr impls, add Show implsAlex Crichton-45/+3
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-02-23Move std::{trie, hashmap} to libcollectionsAlex Crichton-85/+0
These two containers are indeed collections, so their place is in libcollections, not in libstd. There will always be a hash map as part of the standard distribution of Rust, but by moving it out of the standard library it makes libstd that much more portable to more platforms and environments. This conveniently also removes the stuttering of 'std::hashmap::HashMap', although 'collections::HashMap' is only one character shorter.
2014-02-21std: rewrite Hash to make it more genericErick Tryzelaar-1/+1
This patch merges IterBytes and Hash traits, which clears up the confusion of using `#[deriving(IterBytes)]` to support hashing. Instead, it now is much easier to use the new `#[deriving(Hash)]` for making a type hashable with a stream hash. Furthermore, it supports custom non-stream-based hashers, such as if a value's hash was cached in a database. This does not yet replace the old IterBytes-hash with this new version.
2014-02-16Delegate ToStr implementation to Show for tuplesBrendan Zabarauskas-48/+0
2014-02-02std,extra: remove use of & support for @[].Huon Wilson-19/+0
2014-02-02libextra: Remove `@str` from all the librariesPatrick Walton-1/+0
2013-12-15Rename To{Str,Bytes}Consume traits to Into*.Chris Morgan-1/+1
That is: - `ToStrConsume` → `IntoStr`; - `ToBytesConsume` → `IntoBytes`.
2013-12-11Make 'self lifetime illegal.Erik Price-1/+1
Also remove all instances of 'self within the codebase. This fixes #10889.
2013-09-30std: Remove usage of fmt!Alex Crichton-4/+4
2013-09-09rename `std::iterator` to `std::iter`Daniel Micay-1/+1
The trait will keep the `Iterator` naming, but a more concise module name makes using the free functions less verbose. The module will define iterables in addition to iterators, as it deals with iteration in general.
2013-08-18More spelling corrections.Huon Wilson-1/+1
2013-08-03remove obsolete `foreach` keywordDaniel Micay-5/+5
this has been replaced by `for`
2013-08-01migrate many `for` loops to `foreach`Daniel Micay-6/+7
2013-07-24ToStr for HashMap does not need value to implement Eq or HashStepan Koltsov-6/+18
2013-07-18Fix warnings in libstd and librusti testsblake2-ppc-1/+1
2013-07-17test: Fix tests.Patrick Walton-1/+0
2013-07-13Split mutable methods out of Set and MapSteven Fackler-1/+1
Fixes most of #4989. I didn't add Persistent{Set,Map} since the only persistent data structure is fun_treemap and its functionality is currently too limited to build a trait out of.
2013-06-28librustc: Fix merge fallout and test cases.Patrick Walton-1/+1
2013-06-28librustc: Disallow "mut" from distributing over bindings.Patrick Walton-6/+11
This is the backwards-incompatible part of per-binding-site "mut".
2013-06-25Deny common lints by default for lib{std,extra}Alex Crichton-2/+2
2013-06-25Add missing import to testsJames Miller-1/+1
2013-06-25Warning policeJames Miller-2/+0
2013-06-24remove old_iterDaniel Micay-1/+0
the `test/run-pass/class-trait-bounded-param.rs` test was xfailed and written in an ancient dialect of Rust so I've just removed it this also removes `to_vec` from DList because it's provided by `std::iter::to_vec` an Iterator implementation is added for OptVec but some transitional internal iterator methods are still left
2013-06-23std::to_str: Use .iter() for HashMap and HashSetblake2-ppc-2/+3
2013-06-23vec: remove BaseIter implementationDaniel Micay-3/+5
I removed the `static-method-test.rs` test because it was heavily based on `BaseIter` and there are plenty of other more complex uses of static methods anyway.
2013-06-18replace #[inline(always)] with #[inline]. r=burningtree.Graydon Hoare-9/+9
2013-06-17Improved std::asciiMarvin Löbel-1/+1
- Fixed tests - Added methods - Renamed casting methods to be shorter closes #7150
2013-06-06libstd: use fmt! in to_str impl for (one|two)-tupleRamkumar Ramachandra-2/+2
The three-tuple uses fmt!, and there's no reason to hand-concatenate strings. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
2013-06-06libstd: fix comment in to_str impl of tupleRamkumar Ramachandra-2/+2
There is a pointer to #4760, which is a closed issue. The real issue is the more general problem described in #4653. Correct the comment. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
2013-06-04librustc: Disallow multiple patterns from appearing in a "let" declaration.Patrick Walton-15/+15
You can still initialize multiple variables at once with "let (x, y) = (1, 2)".
2013-05-31bool: rm functions duplicating methodsDaniel Micay-4/+0
2013-05-30Require documentation by default for libstdAlex Crichton-1/+3
Adds documentation for various things that I understand. Adds #[allow(missing_doc)] for lots of things that I don't understand.
2013-05-28Remove unnecessary allocations flagged by lintSeo Sanghyeon-2/+2
2013-05-22libstd: Rename libcore to libstd and libstd to libextra; update makefiles.Patrick Walton-0/+240
This only changes the directory names; it does not change the "real" metadata names.