Pacify clippy

This commit is contained in:
Michael Vines
2022-01-21 16:01:22 -08:00
parent ce4f7601af
commit 6d5bbca630
37 changed files with 157 additions and 194 deletions

View File

@ -418,7 +418,7 @@ fn build_bpf_package(config: &Config, target_directory: &Path, package: &cargo_m
);
None
}
1 => Some(cdylib_targets[0].replace("-", "_")),
1 => Some(cdylib_targets[0].replace('-', "_")),
_ => {
eprintln!(
"{} crate contains multiple cdylib targets: {:?}",
@ -821,7 +821,7 @@ fn main() {
dump: matches.is_present("dump"),
features: values_t!(matches, "features", String)
.ok()
.unwrap_or_else(Vec::new),
.unwrap_or_default(),
generate_child_script_on_failure: matches.is_present("generate_child_script_on_failure"),
no_default_features: matches.is_present("no_default_features"),
offline: matches.is_present("offline"),

View File

@ -309,10 +309,10 @@ fn main() {
bpf_out_dir: value_t!(matches, "bpf_out_dir", String).ok(),
extra_cargo_test_args: values_t!(matches, "extra_cargo_test_args", String)
.ok()
.unwrap_or_else(Vec::new),
.unwrap_or_default(),
features: values_t!(matches, "features", String)
.ok()
.unwrap_or_else(Vec::new),
.unwrap_or_default(),
generate_child_script_on_failure: matches.is_present("generate_child_script_on_failure"),
test_name: value_t!(matches, "test", String).ok(),
no_default_features: matches.is_present("no_default_features"),

View File

@ -188,7 +188,7 @@ mod tests {
fn packed_len() {
assert_eq!(
get_packed_len::<TestEnum>(),
size_of::<u8>() + size_of::<u64>() + size_of::<u8>() * 8
size_of::<u8>() + size_of::<u64>() + u8::BITS as usize
);
assert_eq!(
get_packed_len::<TestStruct>(),

View File

@ -161,7 +161,7 @@ fn get_data_slice<'a>(
if signature_index >= instruction_datas.len() {
return Err(PrecompileError::InvalidDataOffsets);
}
&instruction_datas[signature_index]
instruction_datas[signature_index]
};
let start = offset_start as usize;

View File

@ -24,7 +24,7 @@ pub fn write_pubkey_file(outfile: &str, pubkey: Pubkey) -> Result<(), Box<dyn st
#[cfg(feature = "full")]
pub fn read_pubkey_file(infile: &str) -> Result<Pubkey, Box<dyn std::error::Error>> {
let f = std::fs::File::open(infile.to_string())?;
let f = std::fs::File::open(infile)?;
let printable: String = serde_json::from_reader(f)?;
use std::str::FromStr;