Skip to content

Commit

Permalink
Merge pull request #59 from willbush/lossy-utf8
Browse files Browse the repository at this point in the history
Replace from_utf8 with more lenient from_utf8_lossy
  • Loading branch information
infinisil committed Apr 29, 2024
2 parents e5a4b5d + 80975bf commit b14e81b
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use crate::validation::{self, Validation::Success};
use crate::NixFileStore;
use relative_path::RelativePathBuf;
use std::path::Path;
use std::str::from_utf8;

use anyhow::Context;
use serde::Deserialize;
Expand Down Expand Up @@ -168,7 +167,7 @@ pub fn check_values(

if !result.status.success() {
// Early return in case evaluation fails
let stderr = from_utf8(&result.stderr)?.to_owned();
let stderr = String::from_utf8_lossy(&result.stderr).to_string();
return Ok(NixpkgsProblem::NixEval(NixEvalError { stderr }).into());
}
// Parse the resulting JSON value
Expand Down

0 comments on commit b14e81b

Please sign in to comment.