diff --git a/src/main.rs b/src/main.rs index f8e3328e8..7f0e2eb65 100644 --- a/src/main.rs +++ b/src/main.rs @@ -119,7 +119,7 @@ fn run_check(check_gir_file: &str) -> Result<(), String> { .ok_or(format!("Failed to get file stem from `{}`", check_gir_file))?; let lib_name = lib_name .to_str() - .ok_or("failed to convert OsStr to str".to_owned())?; + .ok_or_else(|| "failed to convert OsStr to str".to_owned())?; let mut library = Library::new(lib_name); let parent = path.parent().ok_or(format!( "Failed to get parent directory from `{}`",