#![warn(
rust_2018_compatibility,
rust_2018_idioms,
rust_2021_compatibility,
missing_docs,
missing_debug_implementations,
missing_copy_implementations
)]
use std::error::Error;
use std::fmt::{Display, Formatter};
use std::fs::read_dir;
use std::path::Path;
pub fn ls() {
let path = Path::new("./");
debug_assert!(path.is_dir());
let dir_contents = read_dir(path).unwrap();
for entry in dir_contents {
println!("{}", entry.unwrap().file_name().into_string().unwrap());
}
}
#[derive(Debug)]
struct LstError;
impl Display for LstError {
fn fmt(&self, _f: &mut Formatter<'_>) -> std::fmt::Result {
todo!()
}
}
impl Error for LstError {}
#[cfg(test)]
mod tests {
#[test]
fn it_works() {
let result = 4;
assert_eq!(result, 4);
}
}