diff options
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() +} |
