about summary refs log tree commit diff
path: root/src/libextra
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-01-10 18:21:21 -0800
committerbors <bors@rust-lang.org>2014-01-10 18:21:21 -0800
commita34727f27657cbed71fb2326dc6f1766fee95a4c (patch)
treef6f124acf2ae8f6ab5808ce3ddb7c99a6cd35285 /src/libextra
parent5a6ca45c8ad26f1ace1c46e6452155d511d065d8 (diff)
parent4fc0452acef1355ba566a30c5bd04ccd3b9acef2 (diff)
downloadrust-a34727f27657cbed71fb2326dc6f1766fee95a4c.tar.gz
rust-a34727f27657cbed71fb2326dc6f1766fee95a4c.zip
auto merge of #11416 : bjz/rust/remove-print-fns, r=alexcrichton
The `print!` and `println!` macros are now the preferred method of printing, and so there is no reason to export the `stdio` functions in the prelude. The functions have also been replaced by their macro counterparts in the tutorial and other documentation so that newcomers don't get confused about what they should be using.
Diffstat (limited to 'src/libextra')
-rw-r--r--src/libextra/getopts.rs14
-rw-r--r--src/libextra/test.rs6
-rw-r--r--src/libextra/url.rs2
-rw-r--r--src/libextra/uuid.rs2
-rw-r--r--src/libextra/workcache.rs2
5 files changed, 13 insertions, 13 deletions
diff --git a/src/libextra/getopts.rs b/src/libextra/getopts.rs
index 78baa4f7ec8..bf86bf526a2 100644
--- a/src/libextra/getopts.rs
+++ b/src/libextra/getopts.rs
@@ -35,17 +35,17 @@
 //! use std::os;
 //!
 //! fn do_work(inp: &str, out: Option<~str>) {
-//!     println(inp);
-//!     println(match out {
-//!         Some(x) => x,
-//!         None => ~"No Output"
-//!     });
+//!     println!("{}", inp);
+//!     match out {
+//!         Some(x) => println!("{}", x),
+//!         None => println!("No Output"),
+//!     }
 //! }
 //!
 //! fn print_usage(program: &str, _opts: &[Opt]) {
 //!     println!("Usage: {} [options]", program);
-//!     println("-o\t\tOutput");
-//!     println("-h --help\tUsage");
+//!     println!("-o\t\tOutput");
+//!     println!("-h --help\tUsage");
 //! }
 //!
 //! fn main() {
diff --git a/src/libextra/test.rs b/src/libextra/test.rs
index 6881d104442..a978d1f65be 100644
--- a/src/libextra/test.rs
+++ b/src/libextra/test.rs
@@ -226,10 +226,10 @@ fn optgroups() -> ~[getopts::groups::OptGroup] {
 
 fn usage(binary: &str, helpstr: &str) {
     let message = format!("Usage: {} [OPTIONS] [FILTER]", binary);
-    println(groups::usage(message, optgroups()));
-    println("");
+    println!("{}", groups::usage(message, optgroups()));
+    println!("");
     if helpstr == "help" {
-        println("\
+        println!("{}", "\
 The FILTER is matched against the name of all tests to run, and if any tests
 have a substring match, only those tests are run.
 
diff --git a/src/libextra/url.rs b/src/libextra/url.rs
index 79886273a15..657ff1737df 100644
--- a/src/libextra/url.rs
+++ b/src/libextra/url.rs
@@ -393,7 +393,7 @@ fn query_from_str(rawquery: &str) -> Query {
  * use extra::url;
  *
  * let query = ~[(~"title", ~"The Village"), (~"north", ~"52.91"), (~"west", ~"4.10")];
- * println(url::query_to_str(&query));  // title=The%20Village&north=52.91&west=4.10
+ * println!("{}", url::query_to_str(&query));  // title=The%20Village&north=52.91&west=4.10
  * ```
  */
 pub fn query_to_str(query: &Query) -> ~str {
diff --git a/src/libextra/uuid.rs b/src/libextra/uuid.rs
index 5a5b3814b74..b9e3e817414 100644
--- a/src/libextra/uuid.rs
+++ b/src/libextra/uuid.rs
@@ -34,7 +34,7 @@ use extra::uuid::Uuid;
 
 fn main() {
     let uuid1 = Uuid::new_v4();
-    println(uuid1.to_str());
+    println!("{}", uuid1.to_str());
 }
  ```
 
diff --git a/src/libextra/workcache.rs b/src/libextra/workcache.rs
index 31f5091dd5f..db4666c42b6 100644
--- a/src/libextra/workcache.rs
+++ b/src/libextra/workcache.rs
@@ -536,5 +536,5 @@ fn test() {
         }
     });
 
-    println(s);
+    println!("{}", s);
 }