Skip to content

Commit 5170e7b

Browse files
Fix Clippy warnings for rustc version 1.65
Two warnings have been introduced and both are from category: needless_borrow This commit is to remove the needless borrow Signed-off-by: Mohamed Omar Asaker <mohamed.omarasaker@arm.com>
1 parent 7fd028b commit 5170e7b

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

src/back/backend_handler.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ impl BackEndHandler {
9797
}
9898

9999
if opcode.is_admin() {
100-
let app =
101-
unwrap_or_else_return!((&app).as_ref().ok_or(ResponseStatus::NotAuthenticated));
100+
let app = unwrap_or_else_return!(app.as_ref().ok_or(ResponseStatus::NotAuthenticated));
102101

103102
if !app.is_admin() {
104103
warn!(

src/key_info_managers/on_disk_manager/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ impl OnDiskKeyInfoManager {
395395
for provider_dir_path in list_dirs(app_name_dir_path)?.iter() {
396396
for key_name_file_path in list_files(provider_dir_path)?.iter() {
397397
let mut key_info = Vec::new();
398-
let mut key_info_file = File::open(&key_name_file_path).with_context(|| {
398+
let mut key_info_file = File::open(key_name_file_path).with_context(|| {
399399
format!(
400400
"Failed to open Key Info Mappings file at {:?}",
401401
key_name_file_path

src/providers/cryptoauthlib/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ impl Provider {
191191
}
192192
}
193193

194-
if None == cryptoauthlib_provider.set_opcodes() {
194+
if cryptoauthlib_provider.set_opcodes().is_none() {
195195
warn!("Failed to setup opcodes for cryptoauthlib_provider");
196196
}
197197

0 commit comments

Comments
 (0)