Skip to content

Commit

Permalink
Fix clippy::needless_borrow (use-ink#295)
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Müller authored Jun 17, 2021
1 parent cf6e81b commit 50d2792
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/cmd/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ fn optimize_wasm(
));
let _ = do_optimization(
crate_metadata.dest_wasm.as_os_str(),
&dest_optimized.as_os_str(),
dest_optimized.as_os_str(),
optimization_passes,
)?;

Expand Down Expand Up @@ -530,9 +530,9 @@ pub(crate) fn execute(
unstable_flags: UnstableFlags,
optimization_passes: OptimizationPasses,
) -> Result<BuildResult> {
let crate_metadata = CrateMetadata::collect(&manifest_path)?;
let crate_metadata = CrateMetadata::collect(manifest_path)?;

assert_compatible_ink_dependencies(&manifest_path, verbosity)?;
assert_compatible_ink_dependencies(manifest_path, verbosity)?;

let build = || -> Result<OptimizationResult> {
maybe_println!(
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ fn extended_metadata(
let repository = contract_package
.repository
.as_ref()
.map(|repo| Url::parse(&repo))
.map(|repo| Url::parse(repo))
.transpose()?;
let homepage = crate_metadata.homepage.clone();
let license = contract_package.license.clone();
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ impl BuildResult {
if let Some(dest_wasm) = self.dest_wasm.as_ref() {
let wasm = format!(
" - {} (the contract's code)\n",
util::base_name(&dest_wasm).bold()
util::base_name(dest_wasm).bold()
);
out.push_str(&wasm);
}
Expand Down
2 changes: 1 addition & 1 deletion src/validate_wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ fn parse_linker_error(field: &str) -> String {
let encoded = field
.strip_prefix(INK_ENFORCE_ERR)
.expect("error marker must exist as prefix");
let hex = serde_hex::from_hex(&encoded).expect("decoding hex failed");
let hex = serde_hex::from_hex(encoded).expect("decoding hex failed");
let decoded = <EnforcedErrors as codec::Decode>::decode(&mut &hex[..]).expect(
"The `EnforcedError` object could not be decoded. The probable\
cause is a mismatch between the ink! definition of the type and the\
Expand Down

0 comments on commit 50d2792

Please sign in to comment.