Skip to content

Commit 19c8c7a

Browse files
committed
Change 'print(fmt!(...))' to printf!/printfln! in src/lib*
1 parent 7a3eaf8 commit 19c8c7a

File tree

27 files changed

+103
-112
lines changed

27 files changed

+103
-112
lines changed

src/libextra/base64.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ impl<'self> ToBase64 for &'self [u8] {
7575
*
7676
* fn main () {
7777
* let str = [52,32].to_base64(standard);
78-
* println(fmt!("%s", str));
78+
* printfln!("%s", str);
7979
* }
8080
* ~~~
8181
*/
@@ -164,7 +164,7 @@ impl<'self> ToBase64 for &'self str {
164164
*
165165
* fn main () {
166166
* let str = "Hello, World".to_base64(standard);
167-
* println(fmt!("%s",str));
167+
* printfln!("%s", str);
168168
* }
169169
* ~~~
170170
*
@@ -194,9 +194,9 @@ impl<'self> FromBase64 for &'self [u8] {
194194
*
195195
* fn main () {
196196
* let str = [52,32].to_base64(standard);
197-
* println(fmt!("%s", str));
197+
* printfln!("%s", str);
198198
* let bytes = str.from_base64();
199-
* println(fmt!("%?",bytes));
199+
* printfln!("%?", bytes);
200200
* }
201201
* ~~~
202202
*/
@@ -271,11 +271,11 @@ impl<'self> FromBase64 for &'self str {
271271
*
272272
* fn main () {
273273
* let hello_str = "Hello, World".to_base64(standard);
274-
* println(fmt!("%s",hello_str));
274+
* printfln!("%s", hello_str);
275275
* let bytes = hello_str.from_base64();
276-
* println(fmt!("%?",bytes));
276+
* printfln!("%?", bytes);
277277
* let result_str = str::from_bytes(bytes);
278-
* println(fmt!("%s",result_str));
278+
* printfln!("%s", result_str);
279279
* }
280280
* ~~~
281281
*/

src/libextra/future.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* # fn make_a_sandwich() {};
2020
* let mut delayed_fib = extra::future::spawn (|| fib(5000) );
2121
* make_a_sandwich();
22-
* println(fmt!("fib(5000) = %?", delayed_fib.get()))
22+
* printfln!("fib(5000) = %?", delayed_fib.get())
2323
* ~~~
2424
*/
2525

src/libextra/getopts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
* }
4545
*
4646
* fn print_usage(program: &str, _opts: &[Opt]) {
47-
* println(fmt!("Usage: %s [options]", program));
47+
* printfln!("Usage: %s [options]", program);
4848
* println("-o\t\tOutput");
4949
* println("-h --help\tUsage");
5050
* }

src/libextra/task_pool.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,6 @@ fn test_task_pool() {
103103
};
104104
let mut pool = TaskPool::new(4, Some(SingleThreaded), f);
105105
for 8.times {
106-
pool.execute(|i| println(fmt!("Hello from thread %u!", *i)));
106+
pool.execute(|i| printfln!("Hello from thread %u!", *i));
107107
}
108108
}

src/libextra/treemap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1200,7 +1200,7 @@ mod test_set {
12001200

12011201
let mut n = 0;
12021202
for m.iter().advance |x| {
1203-
println(fmt!("%?", x));
1203+
printfln!(x);
12041204
assert_eq!(*x, n);
12051205
n += 1
12061206
}

src/librust/rust.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,13 @@ fn cmd_help(args: &[~str]) -> ValidUsage {
132132
match find_cmd(command_string) {
133133
Some(command) => {
134134
match command.action {
135-
CallMain(prog, _) => io::println(fmt!(
135+
CallMain(prog, _) => printfln!(
136136
"The %s command is an alias for the %s program.",
137-
command.cmd, prog)),
137+
command.cmd, prog),
138138
_ => ()
139139
}
140140
match command.usage_full {
141-
UsgStr(msg) => io::println(fmt!("%s\n", msg)),
141+
UsgStr(msg) => printfln!("%s\n", msg),
142142
UsgCall(f) => f(),
143143
}
144144
Valid(0)
@@ -211,8 +211,7 @@ fn usage() {
211211

212212
for COMMANDS.iter().advance |command| {
213213
let padding = " ".repeat(INDENT - command.cmd.len());
214-
io::println(fmt!(" %s%s%s",
215-
command.cmd, padding, command.usage_line));
214+
printfln!(" %s%s%s", command.cmd, padding, command.usage_line);
216215
}
217216

218217
io::print(

src/librustc/back/passes.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,15 +191,15 @@ pub fn list_passes() {
191191

192192
io::println("\nAnalysis Passes:");
193193
for analysis_passes.iter().advance |&(name, desc)| {
194-
io::println(fmt!(" %-30s -- %s", name, desc));
194+
printfln!(" %-30s -- %s", name, desc);
195195
}
196196
io::println("\nTransformation Passes:");
197197
for transform_passes.iter().advance |&(name, desc)| {
198-
io::println(fmt!(" %-30s -- %s", name, desc));
198+
printfln!(" %-30s -- %s", name, desc);
199199
}
200200
io::println("\nUtility Passes:");
201201
for utility_passes.iter().advance |&(name, desc)| {
202-
io::println(fmt!(" %-30s -- %s", name, desc));
202+
printfln!(" %-30s -- %s", name, desc);
203203
}
204204
}
205205

@@ -344,7 +344,7 @@ fn passes_exist() {
344344
if failed.len() > 0 {
345345
io::println("Some passes don't exist:");
346346
for failed.iter().advance |&n| {
347-
io::println(fmt!(" %s", n));
347+
printfln!(" %s", n);
348348
}
349349
fail!();
350350
}

src/librustc/metadata/encoder.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1624,16 +1624,16 @@ pub fn encode_metadata(parms: EncodeParams, crate: &crate) -> ~[u8] {
16241624
}
16251625

16261626
io::println("metadata stats:");
1627-
io::println(fmt!(" inline bytes: %u", ecx.stats.inline_bytes));
1628-
io::println(fmt!(" attribute bytes: %u", ecx.stats.attr_bytes));
1629-
io::println(fmt!(" dep bytes: %u", ecx.stats.dep_bytes));
1630-
io::println(fmt!(" lang item bytes: %u", ecx.stats.lang_item_bytes));
1631-
io::println(fmt!(" link args bytes: %u", ecx.stats.link_args_bytes));
1632-
io::println(fmt!(" misc bytes: %u", ecx.stats.misc_bytes));
1633-
io::println(fmt!(" item bytes: %u", ecx.stats.item_bytes));
1634-
io::println(fmt!(" index bytes: %u", ecx.stats.index_bytes));
1635-
io::println(fmt!(" zero bytes: %u", ecx.stats.zero_bytes));
1636-
io::println(fmt!(" total bytes: %u", ecx.stats.total_bytes));
1627+
printfln!(" inline bytes: %u", ecx.stats.inline_bytes);
1628+
printfln!(" attribute bytes: %u", ecx.stats.attr_bytes);
1629+
printfln!(" dep bytes: %u", ecx.stats.dep_bytes);
1630+
printfln!(" lang item bytes: %u", ecx.stats.lang_item_bytes);
1631+
printfln!(" link args bytes: %u", ecx.stats.link_args_bytes);
1632+
printfln!(" misc bytes: %u", ecx.stats.misc_bytes);
1633+
printfln!(" item bytes: %u", ecx.stats.item_bytes);
1634+
printfln!(" index bytes: %u", ecx.stats.index_bytes);
1635+
printfln!(" zero bytes: %u", ecx.stats.zero_bytes);
1636+
printfln!(" total bytes: %u", ecx.stats.total_bytes);
16371637
}
16381638

16391639
// Pad this, since something (LLVM, presumably) is cutting off the

src/librustc/middle/borrowck/mod.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,16 @@ pub fn check_crate(
9393

9494
if tcx.sess.borrowck_stats() {
9595
io::println("--- borrowck stats ---");
96-
io::println(fmt!("paths requiring guarantees: %u",
97-
bccx.stats.guaranteed_paths));
98-
io::println(fmt!("paths requiring loans : %s",
99-
make_stat(bccx, bccx.stats.loaned_paths_same)));
100-
io::println(fmt!("paths requiring imm loans : %s",
101-
make_stat(bccx, bccx.stats.loaned_paths_imm)));
102-
io::println(fmt!("stable paths : %s",
103-
make_stat(bccx, bccx.stats.stable_paths)));
104-
io::println(fmt!("paths requiring purity : %s",
105-
make_stat(bccx, bccx.stats.req_pure_paths)));
96+
printfln!("paths requiring guarantees: %u",
97+
bccx.stats.guaranteed_paths);
98+
printfln!("paths requiring loans : %s",
99+
make_stat(bccx, bccx.stats.loaned_paths_same));
100+
printfln!("paths requiring imm loans : %s",
101+
make_stat(bccx, bccx.stats.loaned_paths_imm));
102+
printfln!("stable paths : %s",
103+
make_stat(bccx, bccx.stats.stable_paths));
104+
printfln!("paths requiring purity : %s",
105+
make_stat(bccx, bccx.stats.req_pure_paths));
106106
}
107107

108108
return (bccx.root_map, bccx.write_guard_map);

src/librustc/middle/trans/base.rs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2999,32 +2999,30 @@ pub fn trans_crate(sess: session::Session,
29992999
write_metadata(ccx, crate);
30003000
if ccx.sess.trans_stats() {
30013001
io::println("--- trans stats ---");
3002-
io::println(fmt!("n_static_tydescs: %u",
3003-
ccx.stats.n_static_tydescs));
3004-
io::println(fmt!("n_glues_created: %u",
3005-
ccx.stats.n_glues_created));
3006-
io::println(fmt!("n_null_glues: %u", ccx.stats.n_null_glues));
3007-
io::println(fmt!("n_real_glues: %u", ccx.stats.n_real_glues));
3008-
3009-
io::println(fmt!("n_fns: %u", ccx.stats.n_fns));
3010-
io::println(fmt!("n_monos: %u", ccx.stats.n_monos));
3011-
io::println(fmt!("n_inlines: %u", ccx.stats.n_inlines));
3012-
io::println(fmt!("n_closures: %u", ccx.stats.n_closures));
3002+
printfln!("n_static_tydescs: %u", ccx.stats.n_static_tydescs);
3003+
printfln!("n_glues_created: %u", ccx.stats.n_glues_created);
3004+
printfln!("n_null_glues: %u", ccx.stats.n_null_glues);
3005+
printfln!("n_real_glues: %u", ccx.stats.n_real_glues);
3006+
3007+
printfln!("n_fns: %u", ccx.stats.n_fns);
3008+
printfln!("n_monos: %u", ccx.stats.n_monos);
3009+
printfln!("n_inlines: %u", ccx.stats.n_inlines);
3010+
printfln!("n_closures: %u", ccx.stats.n_closures);
30133011
io::println("fn stats:");
30143012
do sort::quick_sort(ccx.stats.fn_stats) |&(_, _, insns_a), &(_, _, insns_b)| {
30153013
insns_a > insns_b
30163014
}
30173015
for ccx.stats.fn_stats.iter().advance |tuple| {
30183016
match *tuple {
30193017
(ref name, ms, insns) => {
3020-
io::println(fmt!("%u insns, %u ms, %s", insns, ms, *name));
3018+
printfln!("%u insns, %u ms, %s", insns, ms, *name);
30213019
}
30223020
}
30233021
}
30243022
}
30253023
if ccx.sess.count_llvm_insns() {
30263024
for ccx.stats.llvm_insns.iter().advance |(k, v)| {
3027-
io::println(fmt!("%-7u %s", *v, *k));
3025+
printfln!("%-7u %s", *v, *k);
30283026
}
30293027
}
30303028

0 commit comments

Comments
 (0)