mirror of
https://codeberg.org/icewind/tf-log-parser.git
synced 2026-06-03 10:14:10 +02:00
lossy utf8
This commit is contained in:
parent
c73828a2db
commit
b95c58a257
2 changed files with 4 additions and 2 deletions
|
|
@ -57,13 +57,14 @@ fn main() -> Result<(), MainError> {
|
|||
if path.extension() == Some(OsStr::new("log")) {
|
||||
// let _ = print!("{} - ", path.display());
|
||||
let read_start = Instant::now();
|
||||
let input = match fs::read_to_string(path) {
|
||||
let input = match fs::read(path) {
|
||||
Ok(input) => input,
|
||||
Err(_e) => {
|
||||
// println!("failed to read file: {}", e);
|
||||
return;
|
||||
}
|
||||
};
|
||||
let input = String::from_utf8_lossy(&input);
|
||||
|
||||
read_time.fetch_add(read_start.elapsed().as_micros() as usize, Ordering::Relaxed);
|
||||
let parse_start = Instant::now();
|
||||
|
|
|
|||
|
|
@ -6,7 +6,8 @@ use tf_log_parser::parse;
|
|||
|
||||
fn main() -> Result<(), MainError> {
|
||||
let path = args().nth(1).expect("No path provided");
|
||||
let content = fs::read_to_string(path)?;
|
||||
let content = fs::read(path)?;
|
||||
let content = String::from_utf8_lossy(&content);
|
||||
|
||||
let log = parse(&content)?;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue