diff options
Diffstat (limited to '2025/read.rs')
| -rw-r--r-- | 2025/read.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/2025/read.rs b/2025/read.rs index a53a3a3..ebd41bd 100644 --- a/2025/read.rs +++ b/2025/read.rs @@ -1,9 +1,9 @@ -use std::{fs, path::Path}; +use std::{fs, path::Path, str::pattern::Pattern}; -pub fn read(file: impl AsRef<Path>) -> Vec<String> { +pub fn read(file: impl AsRef<Path>, p: impl Pattern) -> Vec<String> { fs::read_to_string(file) .expect("Failed to read file") - .lines() + .split(p) .map(|l| l.to_string()) .collect() } |
