Logo

Programming-Idioms

History of Idiom 180 > diff from v8 to v9

Edit summary for version 9 by Debaran:
[Rust] Added explanation

Version 8

2019-02-01, 05:42:38

Version 9

2019-02-01, 05:44:07

Idiom #180 List files in directory

Create list x containing the contents of directory d.

x may contain files and subfolders.
No recursive subfolder listing.

Idiom #180 List files in directory

Create list x containing the contents of directory d.

x may contain files and subfolders.
No recursive subfolder listing.

Extra Keywords
folder ls dir listing
Extra Keywords
folder ls dir listing
Imports
use std::fs;
Imports
use std::fs;
Code
let x = fs::read_dir(d).unwrap();
Code
let x = fs::read_dir(d).unwrap();
Comments bubble
x is a fs::ReadDir iterator over std::io::Result<fs::DirEntry>
Doc URL
https://doc.rust-lang.org/std/fs/fn.read_dir.html
Doc URL
https://doc.rust-lang.org/std/fs/fn.read_dir.html