Skip to content

Commit 79b87da

Browse files
committed
---
yaml --- r: 273079 b: refs/heads/beta c: ec39a76 h: refs/heads/master i: 273077: c4f6b4a 273075: 91418de 273071: 29b9e55
1 parent 34ff2c6 commit 79b87da

File tree

5 files changed

+114
-90
lines changed

5 files changed

+114
-90
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 06074ac004701bff42c625247c4764b2ae6fca6c
26+
refs/heads/beta: ec39a76a3e8a96563845eca4eb77f3ba2a2090a9
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/src/libcollections/string.rs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ use core::str::pattern::Pattern;
6666
use rustc_unicode::char::{decode_utf16, REPLACEMENT_CHARACTER};
6767
use rustc_unicode::str as unicode_str;
6868

69-
use borrow::Cow;
69+
use borrow::{Cow, ToOwned};
7070
use range::RangeArgument;
7171
use str::{self, FromStr, Utf8Error, Chars};
7272
use vec::Vec;
@@ -1797,20 +1797,8 @@ impl AsRef<[u8]> for String {
17971797

17981798
#[stable(feature = "rust1", since = "1.0.0")]
17991799
impl<'a> From<&'a str> for String {
1800-
#[cfg(not(test))]
1801-
#[inline]
18021800
fn from(s: &'a str) -> String {
1803-
String { vec: <[_]>::to_vec(s.as_bytes()) }
1804-
}
1805-
1806-
// HACK(japaric): with cfg(test) the inherent `[T]::to_vec` method, which is
1807-
// required for this method definition, is not available. Since we don't
1808-
// require this method for testing purposes, I'll just stub it
1809-
// NB see the slice::hack module in slice.rs for more information
1810-
#[inline]
1811-
#[cfg(test)]
1812-
fn from(_: &str) -> String {
1813-
panic!("not available with cfg(test)");
1801+
s.to_owned()
18141802
}
18151803
}
18161804

0 commit comments

Comments
 (0)