about summary refs log tree commit diff
path: root/src/librustpkg/package_source.rs
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2013-10-29 23:31:07 -0700
committerAlex Crichton <alex@alexcrichton.com>2013-11-03 15:15:42 -0800
commitf19d0833625c382c5d0a8868924cd4620335e659 (patch)
tree9d4d67c3f845aa4f2596c6db94f9c883ab1dd696 /src/librustpkg/package_source.rs
parent9c1851019f1ef9511fa8731b8f1acb0796d1e97f (diff)
downloadrust-f19d0833625c382c5d0a8868924cd4620335e659.tar.gz
rust-f19d0833625c382c5d0a8868924cd4620335e659.zip
Fill out the remaining functionality in io::file
This adds bindings to the remaining functions provided by libuv, all of which
are useful operations on files which need to get exposed somehow.

Some highlights:

* Dropped `FileReader` and `FileWriter` and `FileStream` for one `File` type
* Moved all file-related methods to be static methods under `File`
* All directory related methods are still top-level functions
* Created `io::FilePermission` types (backed by u32) that are what you'd expect
* Created `io::FileType` and refactored `FileStat` to use FileType and
  FilePermission
* Removed the expanding matrix of `FileMode` operations. The mode of reading a
  file will not have the O_CREAT flag, but a write mode will always have the
  O_CREAT flag.

Closes #10130
Closes #10131
Closes #10121
Diffstat (limited to 'src/librustpkg/package_source.rs')
-rw-r--r--src/librustpkg/package_source.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/librustpkg/package_source.rs b/src/librustpkg/package_source.rs
index a52aa68e1e4..5e3a90bbf58 100644
--- a/src/librustpkg/package_source.rs
+++ b/src/librustpkg/package_source.rs
@@ -14,6 +14,7 @@ use target::*;
 use package_id::PkgId;
 use std::rt::io;
 use std::rt::io::file;
+use std::rt::io::File;
 use std::os;
 use context::*;
 use crate::Crate;
@@ -301,7 +302,7 @@ impl PkgSrc {
                 // Move clone_target to local.
                 // First, create all ancestor directories.
                 let moved = make_dir_rwx_recursive(&local.dir_path())
-                    && io::result(|| file::rename(&clone_target, local)).is_ok();
+                    && io::result(|| File::rename(&clone_target, local)).is_ok();
                 if moved { Some(local.clone()) }
                     else { None }
             }
@@ -350,7 +351,7 @@ impl PkgSrc {
 
         let prefix = self.start_dir.component_iter().len();
         debug!("Matching against {}", self.id.short_name);
-        do file::walk_dir(&self.start_dir) |pth| {
+        for pth in file::walk_dir(&self.start_dir) {
             let maybe_known_crate_set = match pth.filename_str() {
                 Some(filename) if filter(filename) => match filename {
                     "lib.rs" => Some(&mut self.libs),
@@ -363,11 +364,10 @@ impl PkgSrc {
             };
 
             match maybe_known_crate_set {
-                Some(crate_set) => PkgSrc::push_crate(crate_set, prefix, pth),
+                Some(crate_set) => PkgSrc::push_crate(crate_set, prefix, &pth),
                 None => ()
             }
-            true
-        };
+        }
 
         let crate_sets = [&self.libs, &self.mains, &self.tests, &self.benchs];
         if crate_sets.iter().all(|crate_set| crate_set.is_empty()) {