Skip to content

Refactoring of fido code#44

Merged
lockedmutex merged 7 commits intomainfrom
refactor
Jan 25, 2026
Merged

Refactoring of fido code#44
lockedmutex merged 7 commits intomainfrom
refactor

Conversation

@Lab-8916100448256
Copy link
Copy Markdown
Member

No description provided.

@Lab-8916100448256 Lab-8916100448256 marked this pull request as draft January 25, 2026 08:20
@Lab-8916100448256
Copy link
Copy Markdown
Member Author

Lab-8916100448256 commented Jan 25, 2026

There are still a few cargo clippy warnings I would like to be fixed before this is merged

$ cargo clippy
    Checking picoforge v0.3.0 (/home/douzeb/gits/librekeys/picoforge/src-tauri)
warning: this import is redundant
 --> src/rescue/mod.rs:9:1
  |
9 | use log;
  | ^^^^^^^^ help: remove it entirely
  |
  = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#single_component_path_imports
  = note: `#[warn(clippy::single_component_path_imports)]` on by default

warning: methods with the following characteristics: (`to_*` and `self` type is `Copy`) usually take `self` by value
   --> src/fido/constants.rs:157:16
    |
157 |     pub fn to_u64(&self) -> u64 {
    |                   ^^^^^
    |
    = help: consider choosing a less ambiguous name
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#wrong_self_convention
    = note: `#[warn(clippy::wrong_self_convention)]` on by default

warning: redundant closure
   --> src/fido/mod.rs:397:37
    |
397 |         let device = get_device().map_err(|e| PFError::Device(e))?;
    |                                           ^^^^^^^^^^^^^^^^^^^^^^ help: replace the closure with the tuple variant itself: `PFError::Device`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#redundant_closure
    = note: `#[warn(clippy::redundant_closure)]` on by default

warning: this `if` statement can be collapsed
   --> src/rescue/mod.rs:325:2
    |
325 | /     if let Some(name) = config.product_name {
326 | |         if !name.is_empty() {
327 | |             let name_bytes = name.as_bytes();
328 | |             let len = name_bytes.len() + 1;
...   |
338 | |     }
    | |_____^
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#collapsible_if
    = note: `#[warn(clippy::collapsible_if)]` on by default
help: collapse nested if block
    |
325 ~     if let Some(name) = config.product_name
326 ~         && !name.is_empty() {
327 |             let name_bytes = name.as_bytes();
...
336 |             tlv.push(0x00); // Null terminator
337 ~         }
    |

warning: name `FIDO` contains a capitalized acronym
  --> src/types.rs:63:2
   |
63 |     FIDO,
   |     ^^^^ help: consider making the acronym lowercase, except the initial letter: `Fido`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.91.0/index.html#upper_case_acronyms
   = note: `#[warn(clippy::upper_case_acronyms)]` on by default

warning: `picoforge` (lib) generated 5 warnings (run `cargo clippy --fix --lib -p picoforge` to apply 3 suggestions)

@Lab-8916100448256 Lab-8916100448256 marked this pull request as ready for review January 25, 2026 13:36
@lockedmutex lockedmutex merged commit 417aac3 into main Jan 25, 2026
@Lab-8916100448256 Lab-8916100448256 deleted the refactor branch March 2, 2026 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants