1.65 changes and clippy fixes

This commit is contained in:
Anton-4 2023-01-17 18:09:16 +01:00
parent 8f62eeaf7e
commit a97c53d7ca
No known key found for this signature in database
GPG key ID: 0971D718C0A9B937
17 changed files with 37 additions and 19 deletions

View file

@ -441,9 +441,9 @@ mod test_snapshots {
fn compare_snapshots(result_path: &Path, actual_result: Option<&str>) {
if std::env::var("ROC_SNAPSHOT_TEST_OVERWRITE").is_ok() {
if let Some(actual_result) = actual_result {
std::fs::write(&result_path, actual_result).unwrap();
std::fs::write(result_path, actual_result).unwrap();
} else {
std::fs::remove_file(&result_path)
std::fs::remove_file(result_path)
.or_else(|e| {
if e.kind() == std::io::ErrorKind::NotFound {
Ok(())
@ -454,7 +454,7 @@ mod test_snapshots {
.unwrap();
}
} else if let Some(actual_result) = actual_result {
let expected_result = std::fs::read_to_string(&result_path).unwrap_or_else(|e| {
let expected_result = std::fs::read_to_string(result_path).unwrap_or_else(|e| {
panic!(
"Error opening test output file {}:\n\
{:?}