Skip to content

Commit 78085da

Browse files
committed
---
yaml --- r: 63174 b: refs/heads/snap-stage3 c: 2fa83c0 h: refs/heads/master v: v3
1 parent add7d1c commit 78085da

File tree

4 files changed

+12
-30
lines changed

4 files changed

+12
-30
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 838191c40bc0411853d2b0d7e98326d08a5060e0
4+
refs/heads/snap-stage3: 2fa83c05035855f4b8f9a8b671d8d7cd69b60f8b
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/librustdoc/desc_to_brief_pass.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ pub fn paragraphs(s: &str) -> ~[~str] {
151151
let paras = do lines.iter().fold(~[]) |paras, line| {
152152
let mut res = paras;
153153

154-
if str::is_whitespace(*line) {
154+
if line.is_whitespace() {
155155
whitespace_lines += 1;
156156
} else {
157157
if whitespace_lines > 0 {

branches/snap-stage3/src/librustdoc/unindent_pass.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ fn unindent(s: &str) -> ~str {
4646
let ignore_previous_indents =
4747
saw_first_line &&
4848
!saw_second_line &&
49-
!str::is_whitespace(*line);
49+
!line.is_whitespace();
5050

5151
let min_indent = if ignore_previous_indents {
5252
uint::max_value
@@ -58,7 +58,7 @@ fn unindent(s: &str) -> ~str {
5858
saw_second_line = true;
5959
}
6060

61-
if str::is_whitespace(*line) {
61+
if line.is_whitespace() {
6262
min_indent
6363
} else {
6464
saw_first_line = true;
@@ -80,7 +80,7 @@ fn unindent(s: &str) -> ~str {
8080
if !lines.is_empty() {
8181
let unindented = ~[lines.head().trim().to_owned()]
8282
+ do lines.tail().map |line| {
83-
if str::is_whitespace(*line) {
83+
if line.is_whitespace() {
8484
copy *line
8585
} else {
8686
assert!(line.len() >= min_indent);

branches/snap-stage3/src/libstd/str.rs

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -981,24 +981,6 @@ fn match_at<'a,'b>(haystack: &'a str, needle: &'b str, at: uint) -> bool {
981981
Section: String properties
982982
*/
983983

984-
/**
985-
* Returns true if the string contains only whitespace
986-
*
987-
* Whitespace characters are determined by `char::is_whitespace`
988-
*/
989-
pub fn is_whitespace(s: &str) -> bool {
990-
s.iter().all(char::is_whitespace)
991-
}
992-
993-
/**
994-
* Returns true if the string contains only alphanumerics
995-
*
996-
* Alphanumeric characters are determined by `char::is_alphanumeric`
997-
*/
998-
fn is_alphanumeric(s: &str) -> bool {
999-
s.iter().all(char::is_alphanumeric)
1000-
}
1001-
1002984
/// Returns the number of characters that a string holds
1003985
#[inline(always)]
1004986
pub fn char_len(s: &str) -> uint { count_chars(s, 0u, s.len()) }
@@ -1749,14 +1731,14 @@ impl<'self> StrSlice<'self> for &'self str {
17491731
* Whitespace characters are determined by `char::is_whitespace`
17501732
*/
17511733
#[inline]
1752-
fn is_whitespace(&self) -> bool { is_whitespace(*self) }
1734+
fn is_whitespace(&self) -> bool { self.iter().all(char::is_whitespace) }
17531735
/**
17541736
* Returns true if the string contains only alphanumerics
17551737
*
17561738
* Alphanumeric characters are determined by `char::is_alphanumeric`
17571739
*/
17581740
#[inline]
1759-
fn is_alphanumeric(&self) -> bool { is_alphanumeric(*self) }
1741+
fn is_alphanumeric(&self) -> bool { self.iter().all(char::is_alphanumeric) }
17601742
/// Returns the size in bytes not counting the null terminator
17611743
#[inline(always)]
17621744
fn len(&self) -> uint {
@@ -2773,11 +2755,11 @@ mod tests {
27732755

27742756
#[test]
27752757
fn test_is_whitespace() {
2776-
assert!(is_whitespace(""));
2777-
assert!(is_whitespace(" "));
2778-
assert!(is_whitespace("\u2009")); // Thin space
2779-
assert!(is_whitespace(" \n\t "));
2780-
assert!(!is_whitespace(" _ "));
2758+
assert!("".is_whitespace());
2759+
assert!(" ".is_whitespace());
2760+
assert!("\u2009".is_whitespace()); // Thin space
2761+
assert!(" \n\t ".is_whitespace());
2762+
assert!(!" _ ".is_whitespace());
27812763
}
27822764

27832765
#[test]

0 commit comments

Comments
 (0)