From d7ff9b456eac35226b6cf06f8c559c7d06eb178b Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Tue, 2 Dec 2025 17:36:33 +0800 Subject: new: day 2 --- 2025/read.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to '2025/read.rs') 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) -> Vec { +pub fn read(file: impl AsRef, p: impl Pattern) -> Vec { fs::read_to_string(file) .expect("Failed to read file") - .lines() + .split(p) .map(|l| l.to_string()) .collect() } -- cgit v1.2.3