Skip to content

Commit 4a2a93f

Browse files
Dretchnikomatsakis
authored andcommitted
---
yaml --- r: 37227 b: refs/heads/try c: 07edf90 h: refs/heads/master i: 37225: 3a3336b 37223: 5db4e7a v: v3
1 parent 3036066 commit 4a2a93f

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 09bb07bed9166105ea961a42b5fff7739ae0d2e9
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: eb8fd119c65c67f3b1b8268cc7341c22d39b7b61
5-
refs/heads/try: e9caa3fe2e291b7f2cea624bfd0dc879e95fe382
5+
refs/heads/try: 07edf9036715bde27cc7bbc0feb3ee6e461130da
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278

branches/try/src/libcore/str.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1869,11 +1869,6 @@ pub pure fn escape_unicode(s: &str) -> ~str {
18691869
move out
18701870
}
18711871

1872-
extern mod rustrt {
1873-
#[rust_stack]
1874-
pure fn upcall_str_new_shared(cstr: *libc::c_char, len: size_t) -> @str;
1875-
}
1876-
18771872
/// Unsafe operations
18781873
pub mod raw {
18791874

@@ -2221,10 +2216,10 @@ impl &str: StrSlice {
22212216

22222217
#[inline]
22232218
pure fn to_managed() -> @str {
2224-
do str::as_buf(self) |p, _len| {
2225-
rustrt::upcall_str_new_shared(p as *libc::c_char,
2226-
self.len() as size_t)
2227-
}
2219+
let v = at_vec::from_fn(self.len() + 1, |i| {
2220+
if i == self.len() { 0 } else { self[i] }
2221+
});
2222+
unsafe { ::cast::transmute(v) }
22282223
}
22292224

22302225
#[inline]

0 commit comments

Comments
 (0)