Skip to content

Commit 9a7d82a

Browse files
committed
---
yaml --- r: 152991 b: refs/heads/try2 c: 16a9258 h: refs/heads/master i: 152989: b6dba70 152987: 4c017ff 152983: 3e88ea9 152975: bf52d02 152959: a102bb3 v: v3
1 parent 10bfffb commit 9a7d82a

File tree

36 files changed

+1745
-2000
lines changed

36 files changed

+1745
-2000
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 721b4cb5c544328d8991216afd7445648a3ce6c6
8+
refs/heads/try2: 16a9258797436498a00726e8aea2ee8a85755e15
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/doc/guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ Save the file, and then type this into your terminal window:
160160

161161
```{bash}
162162
$ rustc hello_world.rs
163-
$ ./hello_world # or hello_world.exe on Windows
163+
$ ./hello_world # just 'hello_world' on Windows
164164
Hello, world
165165
```
166166

@@ -243,7 +243,7 @@ There are now two files: our source code, with the `.rs` extension, and the
243243
executable (`hello_world.exe` on Windows, `hello_world` everywhere else)
244244

245245
```{bash}
246-
$ ./hello_world # or hello_world.exe on Windows
246+
$ ./hello_world # or ./hello_world.exe on Windows
247247
```
248248

249249
This prints out our `Hello, world!` text to our terminal.

branches/try2/src/libcollections/str.rs

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,6 @@ pub fn from_utf8_owned(vv: Vec<u8>) -> Result<String, Vec<u8>> {
106106
/// # Failure
107107
///
108108
/// Fails if invalid UTF-8
109-
///
110-
/// # Example
111-
///
112-
/// ```rust
113-
/// use std::str;
114-
/// let string = str::from_byte(66u8);
115-
/// assert_eq!(string.as_slice(), "B");
116-
/// ```
117109
pub fn from_byte(b: u8) -> String {
118110
assert!(b < 128u8);
119111
String::from_char(1, b as char)
@@ -811,9 +803,15 @@ pub trait StrAllocating: Str {
811803
}
812804

813805
/// Converts to a vector of `u16` encoded as UTF-16.
814-
#[deprecated = "use `utf16_units` instead"]
815806
fn to_utf16(&self) -> Vec<u16> {
816-
self.as_slice().utf16_units().collect::<Vec<u16>>()
807+
let me = self.as_slice();
808+
let mut u = Vec::new();
809+
for ch in me.chars() {
810+
let mut buf = [0u16, ..2];
811+
let n = ch.encode_utf16(buf /* as mut slice! */);
812+
u.push_all(buf.slice_to(n));
813+
}
814+
u
817815
}
818816

819817
/// Given a string, make a new string with repeated copies of it.
@@ -1621,17 +1619,14 @@ mod tests {
16211619

16221620
for p in pairs.iter() {
16231621
let (s, u) = (*p).clone();
1624-
let s_as_utf16 = s.as_slice().utf16_units().collect::<Vec<u16>>();
1625-
let u_as_string = from_utf16(u.as_slice()).unwrap();
1626-
16271622
assert!(is_utf16(u.as_slice()));
1628-
assert_eq!(s_as_utf16, u);
1623+
assert_eq!(s.to_utf16(), u);
16291624

1630-
assert_eq!(u_as_string, s);
1625+
assert_eq!(from_utf16(u.as_slice()).unwrap(), s);
16311626
assert_eq!(from_utf16_lossy(u.as_slice()), s);
16321627

1633-
assert_eq!(from_utf16(s_as_utf16.as_slice()).unwrap(), s);
1634-
assert_eq!(u_as_string.as_slice().utf16_units().collect::<Vec<u16>>(), u);
1628+
assert_eq!(from_utf16(s.to_utf16().as_slice()).unwrap(), s);
1629+
assert_eq!(from_utf16(u.as_slice()).unwrap().to_utf16(), u);
16351630
}
16361631
}
16371632

branches/try2/src/libcore/fmt/mod.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -518,9 +518,6 @@ impl<'a, T: Show> Show for &'a T {
518518
impl<'a, T: Show> Show for &'a mut T {
519519
fn fmt(&self, f: &mut Formatter) -> Result { secret_show(&**self, f) }
520520
}
521-
impl<'a> Show for &'a Show {
522-
fn fmt(&self, f: &mut Formatter) -> Result { (*self).fmt(f) }
523-
}
524521

525522
impl Bool for bool {
526523
fn fmt(&self, f: &mut Formatter) -> Result {

0 commit comments

Comments
 (0)