Skip to content

Commit f74e193

Browse files
committed
auto merge of #7123 : huonw/rust/more-str, r=thestinger
Moves all the remaining functions that could reasonably be methods to be methods, except for some FFI ones (which I believe @erickt is working on, possibly) and `each_split_within`, since I'm not really sure the details of it (I believe @Kimundi wrote the current implementation, so maybe he could convert it to an external iterator method on `StrSlice`, e.g. `word_wrap_iter(&self) -> WordWrapIterator<'self>`, where `WordWrapIterator` impls `Iterator<&'self str>`. It probably won't be too hard, since it's already a state machine.) This also cleans up the comparison impls for the string types, except I'm not sure how the lang items `eq_str` and `eq_str_uniq` need to be handled, so they (`eq_slice` and `eq`) remain stand-alone functions.
2 parents 8482d29 + bbcff95 commit f74e193

34 files changed

+342
-430
lines changed

src/compiletest/runtest.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ use util::logv;
2424

2525
use core::io;
2626
use core::os;
27-
use core::str;
2827
use core::uint;
2928
use core::vec;
3029

src/libextra/base64.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,6 @@ impl<'self> FromBase64 for &'self str {
229229

230230
#[cfg(test)]
231231
mod tests {
232-
use core::str;
233-
234232
#[test]
235233
fn test_to_base64() {
236234
assert_eq!("".to_base64(), ~"");

src/libextra/rope.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1271,7 +1271,6 @@ mod tests {
12711271

12721272
use rope::*;
12731273

1274-
use core::str;
12751274
use core::uint;
12761275
use core::vec;
12771276

src/libextra/sha1.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
use core::prelude::*;
2626

27-
use core::str;
2827
use core::uint;
2928
use core::vec;
3029

@@ -279,8 +278,6 @@ pub fn sha1() -> @Sha1 {
279278
mod tests {
280279
use sha1;
281280

282-
use core::vec;
283-
284281
#[test]
285282
fn test() {
286283
struct Test {

src/libextra/smallintmap.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -294,11 +294,6 @@ mod tests {
294294

295295
use super::SmallIntMap;
296296

297-
use core::local_data;
298-
use core::rand;
299-
use core::uint;
300-
use core::vec;
301-
302297
#[test]
303298
fn test_find_mut() {
304299
let mut m = SmallIntMap::new();

src/libextra/sort.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,6 @@ fn shift_vec<T:Copy>(dest: &mut [T],
751751
mod test_qsort3 {
752752
use sort::*;
753753

754-
use core::vec;
755754

756755
fn check_sort(v1: &mut [int], v2: &mut [int]) {
757756
let len = v1.len();
@@ -861,8 +860,6 @@ mod tests {
861860

862861
use sort::*;
863862

864-
use core::vec;
865-
866863
fn check_sort(v1: &[int], v2: &[int]) {
867864
let len = v1.len();
868865
pub fn le(a: &int, b: &int) -> bool { *a <= *b }

src/libextra/stats.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
use core::prelude::*;
1414

15-
use core::vec;
1615
use core::f64;
1716
use core::cmp;
1817
use core::num;

src/libextra/std.rc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ not required in or otherwise suitable for the core library.
3737

3838
extern mod core(name = "std", vers = "0.7-pre");
3939

40+
#[cfg(stage0)]
4041
use core::{str, unstable};
4142
use core::str::{StrSlice, OwnedStr};
4243

src/libextra/tempfile.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ mod tests {
3636
use tempfile::mkdtemp;
3737

3838
use core::os;
39-
use core::str;
4039

4140
#[test]
4241
fn test_mkdtemp() {

src/libextra/terminfo/parser/compiled.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,6 @@ pub fn parse(file: @Reader, longnames: bool) -> Result<~TermInfo, ~str> {
313313
#[cfg(test)]
314314
mod test {
315315
use super::*;
316-
use p = core::path::Path;
317316

318317
#[test]
319318
fn test_veclens() {

0 commit comments

Comments
 (0)