diff options
| author | Tim Chevalier <catamorphism@gmail.com> | 2012-10-12 15:26:33 -0700 |
|---|---|---|
| committer | Tim Chevalier <catamorphism@gmail.com> | 2012-10-12 15:26:33 -0700 |
| commit | fe058374a94c511daf63b7d773f3b4c95e368a2a (patch) | |
| tree | d992d648999c3e5ed947fc1db4b35af08fd2f9f8 /src/libstd | |
| parent | 45d1cd83ab903d377f3b03fd2dc74da42100e308 (diff) | |
| parent | 1bede1f5e0012069feaf093a6287256af606ff92 (diff) | |
| download | rust-fe058374a94c511daf63b7d773f3b4c95e368a2a.tar.gz rust-fe058374a94c511daf63b7d773f3b4c95e368a2a.zip | |
Merge pull request #3746 from killerswan/nuke_fmt
Replace several common macros of the form #m[...] with m!(...)
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/net_url.rs | 16 | ||||
| -rw-r--r-- | src/libstd/serialization.rs | 2 | ||||
| -rw-r--r-- | src/libstd/time.rs | 3 |
3 files changed, 10 insertions, 11 deletions
diff --git a/src/libstd/net_url.rs b/src/libstd/net_url.rs index c3fd3383979..109e71a3eaa 100644 --- a/src/libstd/net_url.rs +++ b/src/libstd/net_url.rs @@ -65,10 +65,10 @@ fn encode_inner(s: &str, full_url: bool) -> ~str { str::push_char(&mut out, ch); } - _ => out += #fmt("%%%X", ch as uint) + _ => out += fmt!("%%%X", ch as uint) } } else { - out += #fmt("%%%X", ch as uint); + out += fmt!("%%%X", ch as uint); } } } @@ -164,7 +164,7 @@ fn encode_plus(s: &str) -> ~str { str::push_char(&mut out, ch); } ' ' => str::push_char(&mut out, '+'), - _ => out += #fmt("%%%X", ch as uint) + _ => out += fmt!("%%%X", ch as uint) } } @@ -190,7 +190,7 @@ pub fn encode_form_urlencoded(m: HashMap<~str, @DVec<@~str>>) -> ~str { first = false; } - out += #fmt("%s=%s", key, encode_plus(**value)); + out += fmt!("%s=%s", key, encode_plus(**value)); } } @@ -332,7 +332,7 @@ pub pure fn query_to_str(query: Query) -> ~str { let (k, v) = copy *kv; // This is really safe... unsafe { - strvec += ~[#fmt("%s=%s", + strvec += ~[fmt!("%s=%s", encode_component(k), encode_component(v))]; } }; @@ -850,7 +850,7 @@ mod tests { fn test_url_parse_host_slash() { let urlstr = ~"http://0.42.42.42/"; let url = from_str(urlstr).get(); - #debug("url: %?", url); + debug!("url: %?", url); assert url.host == ~"0.42.42.42"; assert url.path == ~"/"; } @@ -859,7 +859,7 @@ mod tests { fn test_url_with_underscores() { let urlstr = ~"http://dotcom.com/file_name.html"; let url = from_str(urlstr).get(); - #debug("url: %?", url); + debug!("url: %?", url); assert url.path == ~"/file_name.html"; } @@ -867,7 +867,7 @@ mod tests { fn test_url_with_dashes() { let urlstr = ~"http://dotcom.com/file-name.html"; let url = from_str(urlstr).get(); - #debug("url: %?", url); + debug!("url: %?", url); assert url.path == ~"/file-name.html"; } diff --git a/src/libstd/serialization.rs b/src/libstd/serialization.rs index 5173ef163a2..b7cf09cc6aa 100644 --- a/src/libstd/serialization.rs +++ b/src/libstd/serialization.rs @@ -375,7 +375,7 @@ pub impl<T: Deserializable> Option<T>: Deserializable { match i { 0 => None, 1 => Some(d.read_enum_variant_arg(0u, || deserialize(d))), - _ => fail(#fmt("Bad variant for option: %u", i)) + _ => fail(fmt!("Bad variant for option: %u", i)) } } } diff --git a/src/libstd/time.rs b/src/libstd/time.rs index 65872a013ab..75909273392 100644 --- a/src/libstd/time.rs +++ b/src/libstd/time.rs @@ -595,8 +595,7 @@ pub fn strptime(s: &str, format: &str) -> Result<Tm, ~str> { fn strftime(format: &str, tm: Tm) -> ~str { fn parse_type(ch: char, tm: &Tm) -> ~str { //FIXME (#2350): Implement missing types. - let die = || #fmt("strftime: can't understand this format %c ", - ch); + let die = || fmt!("strftime: can't understand this format %c ", ch); match ch { 'A' => match tm.tm_wday as int { 0 => ~"Sunday", |
