1#![warn(
2 rust_2018_compatibility,
3 rust_2018_idioms,
4 rust_2021_compatibility,
5 missing_docs,
6 missing_debug_implementations,
7 missing_copy_implementations
8)]
9
10use std::error::Error;
13use std::fmt::{Display, Formatter};
14use std::fs::read_dir;
15use std::path::Path;
16
17pub fn ls() {
24 let path = Path::new("./");
25 debug_assert!(path.is_dir());
26
27 let dir_contents = read_dir(path).unwrap();
28 for entry in dir_contents {
29 println!("{}", entry.unwrap().file_name().into_string().unwrap());
30 }
31}
32
33#[derive(Debug)]
34struct LstError;
35
36impl Display for LstError {
37 fn fmt(&self, _f: &mut Formatter<'_>) -> std::fmt::Result {
38 todo!()
39 }
40}
41impl Error for LstError {}
42
43#[cfg(test)]
44mod tests {
45 #[test]
48 fn it_works() {
49 let result = 4;
50 assert_eq!(result, 4);
51 }
52}