Clippy improvements (#408)

* clippy: Allow subsec_nanos usage for now.

The recommendation from clippy requires Rust 1.27, but we currently
support Rust 1.25 and later.

* Simplify ref pattern matches.

This was recommended by clippy.
This commit is contained in:
Bruce Mitchener
2018-08-03 12:10:51 +07:00
committed by Dan Gohman
parent c0af810ec0
commit 76a7efc8db
3 changed files with 10 additions and 4 deletions

View File

@@ -362,15 +362,15 @@ impl<'a> RelocSink for FaerieRelocSink<'a> {
name: &ir::ExternalName,
addend: Addend,
) {
let ref_name: String = match name {
&ir::ExternalName::User { .. } => {
let ref_name: String = match *name {
ir::ExternalName::User { .. } => {
if self.namespace.is_function(name) {
self.namespace.get_function_decl(name).name.clone()
} else {
self.namespace.get_data_decl(name).name.clone()
}
}
&ir::ExternalName::LibCall(ref libcall) => {
ir::ExternalName::LibCall(ref libcall) => {
let sym = (self.libcall_names)(*libcall);
self.artifact
.declare(sym.clone(), faerie::Decl::FunctionImport)