Skip to content

Commit cff6aba

Browse files
committed
libcore: Export core::from_str::FromStr from core::prelude
1 parent 5458d7d commit cff6aba

File tree

13 files changed

+16
-20
lines changed

13 files changed

+16
-20
lines changed

src/libcore/bool.rs

+1
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ mod tests {
108108

109109
#[test]
110110
fn test_bool_from_str() {
111+
#[cfg(stage0)]
111112
use from_str::FromStr;
112113

113114
do all_values |v| {

src/libcore/cast.rs

+2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010

1111
//! Unsafe casting functions
1212
13+
#[cfg(not(stage0))]
1314
use sys;
15+
#[cfg(not(stage0))]
1416
use unstable;
1517

1618
pub mod rusti {

src/libcore/core.rc

+1
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ pub use num::{Bitwise, BitCount, Bounded};
111111
pub use num::{Primitive, Int, Float};
112112

113113
pub use ptr::Ptr;
114+
pub use from_str::FromStr;
114115
pub use to_str::ToStr;
115116
pub use clone::Clone;
116117

src/libcore/flate.rs

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ Simple compression
1616

1717
use libc;
1818
use libc::{c_void, size_t, c_int};
19-
use ptr;
2019
use vec;
2120

2221
#[cfg(test)] use rand;

src/libcore/num/f32.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
//! Operations and constants for `f32`
1212
13-
use from_str;
1413
use num::{Zero, One, strconv};
1514
use prelude::*;
1615

@@ -798,7 +797,7 @@ pub fn from_str_radix(num: &str, rdx: uint) -> Option<f32> {
798797
strconv::ExpNone, false, false)
799798
}
800799
801-
impl from_str::FromStr for f32 {
800+
impl FromStr for f32 {
802801
#[inline(always)]
803802
fn from_str(val: &str) -> Option<f32> { from_str(val) }
804803
}

src/libcore/num/f64.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
//! Operations and constants for `f64`
1212
13-
use from_str;
1413
use libc::c_int;
1514
use num::{Zero, One, strconv};
1615
use prelude::*;
@@ -840,7 +839,7 @@ pub fn from_str_radix(num: &str, rdx: uint) -> Option<f64> {
840839
strconv::ExpNone, false, false)
841840
}
842841
843-
impl from_str::FromStr for f64 {
842+
impl FromStr for f64 {
844843
#[inline(always)]
845844
fn from_str(val: &str) -> Option<f64> { from_str(val) }
846845
}

src/libcore/num/float.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
// PORT this must match in width according to architecture
2222

23-
use from_str;
2423
use libc::c_int;
2524
use num::{Zero, One, strconv};
2625
use prelude::*;
@@ -289,7 +288,7 @@ pub fn from_str_radix(num: &str, radix: uint) -> Option<float> {
289288
strconv::ExpNone, false, false)
290289
}
291290
292-
impl from_str::FromStr for float {
291+
impl FromStr for float {
293292
#[inline(always)]
294293
fn from_str(val: &str) -> Option<float> { from_str(val) }
295294
}

src/libcore/num/int-template.rs

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
use T = self::inst::T;
1212

13-
use from_str::FromStr;
1413
use num::{ToStrRadix, FromStrRadix};
1514
use num::{Zero, One, strconv};
1615
use prelude::*;

src/libcore/num/uint-template.rs

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use T = self::inst::T;
1212
use T_SIGNED = self::inst::T_SIGNED;
1313

14-
use from_str::FromStr;
1514
use num::{ToStrRadix, FromStrRadix};
1615
use num::{Zero, One, strconv};
1716
use prelude::*;

src/libcore/pipes.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ struct BufferResource<T> {
303303
}
304304
305305
#[unsafe_destructor]
306-
impl<T> ::ops::Drop for BufferResource<T> {
306+
impl<T> Drop for BufferResource<T> {
307307
fn finalize(&self) {
308308
unsafe {
309309
let b = move_it!(self.buffer);
@@ -639,7 +639,7 @@ pub struct SendPacketBuffered<T, Tbuffer> {
639639
}
640640
641641
#[unsafe_destructor]
642-
impl<T:Owned,Tbuffer:Owned> ::ops::Drop for SendPacketBuffered<T,Tbuffer> {
642+
impl<T:Owned,Tbuffer:Owned> Drop for SendPacketBuffered<T,Tbuffer> {
643643
fn finalize(&self) {
644644
//if self.p != none {
645645
// debug!("drop send %?", option::get(self.p));
@@ -708,7 +708,7 @@ pub struct RecvPacketBuffered<T, Tbuffer> {
708708
}
709709
710710
#[unsafe_destructor]
711-
impl<T:Owned,Tbuffer:Owned> ::ops::Drop for RecvPacketBuffered<T,Tbuffer> {
711+
impl<T:Owned,Tbuffer:Owned> Drop for RecvPacketBuffered<T,Tbuffer> {
712712
fn finalize(&self) {
713713
//if self.p != none {
714714
// debug!("drop recv %?", option::get(self.p));

src/libcore/prelude.rs

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ pub use path::WindowsPath;
5151
pub use ptr::Ptr;
5252
pub use ascii::{Ascii, AsciiCast, OwnedAsciiCast, AsciiStr};
5353
pub use str::{StrSlice, OwnedStr};
54+
pub use from_str::{FromStr};
5455
pub use to_bytes::IterBytes;
5556
pub use to_str::{ToStr, ToStrConsume};
5657
pub use tuple::{CopyableTuple, ImmutableTuple, ExtendedTupleOps};

src/libstd/net_url.rs

+3-5
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,13 @@
1313
#[allow(deprecated_mode)];
1414

1515
use core::cmp::Eq;
16+
#[cfg(stage0)]
1617
use core::from_str::FromStr;
1718
use core::io::{Reader, ReaderUtil};
1819
use core::io;
1920
use core::hashmap::HashMap;
2021
use core::str;
21-
use core::to_bytes::IterBytes;
2222
use core::to_bytes;
23-
use core::to_str::ToStr;
24-
use core::to_str;
2523
use core::uint;
2624

2725
#[deriving(Clone, Eq)]
@@ -703,13 +701,13 @@ pub fn to_str(url: &Url) -> ~str {
703701
fmt!("%s:%s%s%s%s", url.scheme, authority, url.path, query, fragment)
704702
}
705703

706-
impl to_str::ToStr for Url {
704+
impl ToStr for Url {
707705
pub fn to_str(&self) -> ~str {
708706
to_str(self)
709707
}
710708
}
711709

712-
impl to_bytes::IterBytes for Url {
710+
impl IterBytes for Url {
713711
fn iter_bytes(&self, lsb0: bool, f: to_bytes::Cb) {
714712
self.to_str().iter_bytes(lsb0, f)
715713
}

src/libstd/num/bigint.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ A BigInt is a combination of BigUint and Sign.
2121

2222
use core::cmp::{Eq, Ord, TotalEq, TotalOrd, Ordering, Less, Equal, Greater};
2323
use core::num::{IntConvertible, Zero, One, ToStrRadix, FromStrRadix};
24-
use core::*;
2524

2625
/**
2726
A BigDigit is a BigUint's composing element.
@@ -141,7 +140,7 @@ impl ToStr for BigUint {
141140
fn to_str(&self) -> ~str { self.to_str_radix(10) }
142141
}
143142

144-
impl from_str::FromStr for BigUint {
143+
impl FromStr for BigUint {
145144
#[inline(always)]
146145
fn from_str(s: &str) -> Option<BigUint> {
147146
FromStrRadix::from_str_radix(s, 10)
@@ -785,7 +784,7 @@ impl ToStr for BigInt {
785784
fn to_str(&self) -> ~str { self.to_str_radix(10) }
786785
}
787786

788-
impl from_str::FromStr for BigInt {
787+
impl FromStr for BigInt {
789788
#[inline(always)]
790789
fn from_str(s: &str) -> Option<BigInt> {
791790
FromStrRadix::from_str_radix(s, 10)

0 commit comments

Comments
 (0)