summary refs log tree commit diff
path: root/src/libstd/io
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2013-12-20 01:12:56 +1100
committerHuon Wilson <dbau.pp+github@gmail.com>2013-12-20 01:26:03 +1100
commitc00104f36a1dd6aad318d410ffa41b9ec531880a (patch)
tree2e317d3960f021384faa3f8ae7f19a9eed1ac849 /src/libstd/io
parentb3cee6203457b98c030a8597f97b037a8d447f40 (diff)
downloadrust-c00104f36a1dd6aad318d410ffa41b9ec531880a.tar.gz
rust-c00104f36a1dd6aad318d410ffa41b9ec531880a.zip
std: silence warnings when compiling test.
Diffstat (limited to 'src/libstd/io')
-rw-r--r--src/libstd/io/native/file.rs11
-rw-r--r--src/libstd/io/util.rs4
2 files changed, 4 insertions, 11 deletions
diff --git a/src/libstd/io/native/file.rs b/src/libstd/io/native/file.rs
index 74d18f11a1d..de2655303d6 100644
--- a/src/libstd/io/native/file.rs
+++ b/src/libstd/io/native/file.rs
@@ -907,22 +907,14 @@ pub fn utime(p: &CString, atime: u64, mtime: u64) -> IoResult<()> {
 #[cfg(test)]
 mod tests {
     use io::native::file::{CFile, FileDesc};
-    use io::fs;
     use io;
     use libc;
     use os;
-    use path::Path;
-    use rand;
     use result::Ok;
     use rt::rtio::RtioFileStream;
 
-    fn tmpdir() -> Path {
-        let ret = os::tmpdir().join(format!("rust-{}", rand::random::<u32>()));
-        fs::mkdir(&ret, io::UserRWX);
-        ret
-    }
-
     #[ignore(cfg(target_os = "freebsd"))] // hmm, maybe pipes have a tiny buffer
+    #[test]
     fn test_file_desc() {
         // Run this test with some pipes so we don't have to mess around with
         // opening or closing files.
@@ -949,6 +941,7 @@ mod tests {
     }
 
     #[ignore(cfg(windows))] // apparently windows doesn't like tmpfile
+    #[test]
     fn test_cfile() {
         unsafe {
             let f = libc::tmpfile();
diff --git a/src/libstd/io/util.rs b/src/libstd/io/util.rs
index 75be56113e9..48030543336 100644
--- a/src/libstd/io/util.rs
+++ b/src/libstd/io/util.rs
@@ -220,7 +220,7 @@ mod test {
     #[test]
     fn test_null_writer() {
         let mut s = NullWriter;
-        let mut buf = ~[0, 0, 0];
+        let buf = ~[0, 0, 0];
         s.write(buf);
         s.flush();
     }
@@ -248,7 +248,7 @@ mod test {
 
         struct TestWriter;
         impl Writer for TestWriter {
-            fn write(&mut self, buf: &[u8]) {
+            fn write(&mut self, _buf: &[u8]) {
                 unsafe { writes += 1 }
             }