Use std::io::Error and remove useless to_string

This commit is contained in:
Adrian Tombu 2022-08-24 14:12:39 +02:00
parent e7ded9246c
commit 1c575c5fe0
No known key found for this signature in database
GPG key ID: 9CD8E979D3A943FE
3 changed files with 6 additions and 6 deletions

View file

@ -586,12 +586,12 @@ pub fn try_process_rlink(sess: &Session, compiler: &interface::Compiler) -> Comp
sess.init_crate_types(collect_crate_types(sess, &[]));
let outputs = compiler.build_output_filenames(sess, &[]);
let rlink_data = fs::read(file).unwrap_or_else(|err| {
sess.emit_fatal(RlinkUnableToRead { error_message: err.to_string() });
sess.emit_fatal(RlinkUnableToRead { err });
});
let codegen_results = match CodegenResults::deserialize_rlink(rlink_data) {
Ok(codegen) => codegen,
Err(error) => {
sess.emit_fatal(RlinkUnableToDeserialize { error_message: error.to_string() });
Err(error_message) => {
sess.emit_fatal(RlinkUnableToDeserialize { error_message });
}
};
let result = compiler.codegen_backend().link(sess, codegen_results, &outputs);