Commit Graph

15 Commits

Author SHA1 Message Date
Scott Olson
55e48420db Minor code cleanup. 2015-09-28 19:21:18 -06:00
Ulrik Sverdrup
bec64090a7 Rename String::into_boxed_slice -> into_boxed_str
This is the name that was decided in rust-lang/rfcs#1152, and it's
better if we say “boxed str” for `Box<str>`.

The old name `String::into_boxed_slice` is deprecated.
2015-08-13 14:02:00 +02:00
Alexis Beingessner
bfa0e1f58a Add RawVec to unify raw Vecish code 2015-07-17 08:29:15 -07:00
Jonathan Reem
69521affbb Add String::into_boxed_slice and Box<str>::into_string
Implements merged RFC 1152.

Closes #26697.
2015-07-11 21:31:56 -07:00
Alex Crichton
ce1a965cf5 Fallout in tests and docs from feature renamings 2015-06-17 09:07:16 -07:00
Joshua Landau
ca7418b846 Removed many pointless calls to *iter() and iter_mut() 2015-06-10 21:14:03 +01:00
bors
02c33b690b Auto merge of #26077 - SimonSapin:patch-6, r=alexcrichton
With the latter is provided by the `From` conversion trait, the former is now completely redundant. Their code is identical. Let’s deprecate now and plan to remove in the next cycle. (It’s `#[unstable]`.)

r? @alexcrichton 
CC @nagisa
2015-06-08 20:52:33 +00:00
Simon Sapin
c160192f5f Replace usage of String::from_str with String:from 2015-06-08 16:55:35 +02:00
Johannes Oertel
b36ed7d2ed Implement RFC 839
Closes #25976.
2015-06-08 12:05:33 +02:00
Ulrik Sverdrup
ee48e6d192 collections: Implement String::drain(range) according to RFC 574
`.drain(range)` is unstable and under feature(collections_drain).

This adds a safe way to remove any range of a String as efficiently as
possible.

As noted in the code, this drain iterator has none of the memory safety
issues of the vector version.

RFC tracking issue is #23055
2015-05-01 19:51:31 +02:00
Erick Tryzelaar
f055054eab collections: Move optimized String::from_str to String::from
This implementation is currently about 3-4 times faster than using
the `.to_string()` based approach.
2015-04-19 10:59:06 -07:00
kwantam
29d1252e4d deprecate Unicode functions that will be moved to crates.io
This patch
1. renames libunicode to librustc_unicode,
2. deprecates several pieces of libunicode (see below), and
3. removes references to deprecated functions from
   librustc_driver and libsyntax. This may change pretty-printed
   output from these modules in cases involving wide or combining
   characters used in filenames, identifiers, etc.

The following functions are marked deprecated:

1. char.width() and str.width():
   --> use unicode-width crate

2. str.graphemes() and str.grapheme_indices():
   --> use unicode-segmentation crate

3. str.nfd_chars(), str.nfkd_chars(), str.nfc_chars(), str.nfkc_chars(),
   char.compose(), char.decompose_canonical(), char.decompose_compatible(),
   char.canonical_combining_class():
   --> use unicode-normalization crate
2015-04-16 17:03:05 -04:00
Alex Crichton
f329030b09 std: Stabilize the Utf8Error type
The meaning of each variant of this enum was somewhat ambiguous and it's uncler
that we wouldn't even want to add more enumeration values in the future. As a
result this error has been altered to instead become an opaque structure.
Learning about the "first invalid byte index" is still an unstable feature, but
the type itself is now stable.
2015-04-10 16:07:46 -07:00
Alex Crichton
d4a2c94180 std: Clean out #[deprecated] APIs
This commit cleans out a large amount of deprecated APIs from the standard
library and some of the facade crates as well, updating all users in the
compiler and in tests as it goes along.
2015-03-31 15:49:57 -07:00
Jorge Aparicio
6453fcd4cc extract libcollections tests into libcollectionstest 2015-03-16 21:57:42 -05:00