diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-12-01 20:07:41 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-12-01 20:07:41 +0800 |
| commit | b55ea16baba3f387a1eece3b60adcbd4db98f6be (patch) | |
| tree | 5809aa9bfd92b64fb51429ba3258c2996d9a7970 /2025/read.rs | |
| parent | 8128b4edcaca761585f6ab81c7c4a9aaff763532 (diff) | |
init: 2025
Diffstat (limited to '2025/read.rs')
| -rw-r--r-- | 2025/read.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/2025/read.rs b/2025/read.rs new file mode 100644 index 0000000..a53a3a3 --- /dev/null +++ b/2025/read.rs @@ -0,0 +1,9 @@ +use std::{fs, path::Path}; + +pub fn read(file: impl AsRef<Path>) -> Vec<String> { + fs::read_to_string(file) + .expect("Failed to read file") + .lines() + .map(|l| l.to_string()) + .collect() +} |
