about summary refs log tree commit diff
path: root/src/libstd/sys/windows/fs.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd/sys/windows/fs.rs')
-rw-r--r--src/libstd/sys/windows/fs.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/sys/windows/fs.rs b/src/libstd/sys/windows/fs.rs
index 632261f0ad9..523d60c71aa 100644
--- a/src/libstd/sys/windows/fs.rs
+++ b/src/libstd/sys/windows/fs.rs
@@ -265,8 +265,8 @@ pub fn readdir(p: &Path) -> IoResult<Vec<Path>> {
                 {
                     let filename = os::truncate_utf16_at_nul(&wfd.cFileName);
                     match String::from_utf16(filename) {
-                        Some(filename) => paths.push(Path::new(filename)),
-                        None => {
+                        Ok(filename) => paths.push(Path::new(filename)),
+                        Err(..) => {
                             assert!(libc::FindClose(find_handle) != 0);
                             return Err(IoError {
                                 kind: io::InvalidInput,