Skip to content

Commit b58702d

Browse files
committed
Ran cargo +nightly fmt on bootloader-tool
1 parent d53188a commit b58702d

File tree

15 files changed

+70
-71
lines changed

15 files changed

+70
-71
lines changed

bootloader-tool/src/commands/download.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1+
use std::path::Path;
2+
3+
use DownloadCommands::Other;
4+
use anyhow::Context;
5+
use probe_rs::flashing::ElfOptions;
6+
use probe_rs::{Session, flashing};
7+
18
use crate::commands::sign::SignOutput;
29
use crate::config::Config;
310
use crate::processors::certificates::Rkth;
411
use crate::processors::probe;
512
use crate::{DownloadCommands, ProbeArgs, RunCommands, SignCommands};
6-
use DownloadCommands::Other;
7-
use anyhow::Context;
8-
use probe_rs::flashing::ElfOptions;
9-
use probe_rs::{Session, flashing};
10-
use std::path::Path;
1113

1214
pub async fn process(config: &Config, command: DownloadCommands) -> anyhow::Result<()> {
1315
match command {

bootloader-tool/src/commands/generate.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
use crate::{GenerateCommands, config::Config, processors};
1+
use crate::config::Config;
2+
use crate::{GenerateCommands, processors};
23

34
pub async fn process(config: &Config, command: GenerateCommands) -> anyhow::Result<()> {
45
match command {

bootloader-tool/src/commands/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ mod generate;
33
mod run;
44
mod sign;
55

6-
use crate::{Commands, config::Config};
6+
use crate::Commands;
7+
use crate::config::Config;
78

89
pub async fn process(config: &Config, command: Commands) -> anyhow::Result<()> {
910
match command {

bootloader-tool/src/commands/run.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
use probe_rs::MemoryInterface;
22

3-
use crate::{RunCommands, commands::download::DownloadOutput, config::Config, processors::otp};
3+
use crate::RunCommands;
4+
use crate::commands::download::DownloadOutput;
5+
use crate::config::Config;
6+
use crate::processors::otp;
47

58
pub async fn process(config: &Config, command: RunCommands) -> anyhow::Result<()> {
69
let otp = otp::get_otp(config)?;

bootloader-tool/src/commands/sign.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1+
use std::path::PathBuf;
2+
3+
use anyhow::Context;
4+
use object::read::elf::ElfFile32;
5+
16
use crate::SignCommands;
27
use crate::config::Config;
38
use crate::processors::certificates::Rkth;
49
use crate::processors::mbi::cert_block;
510
use crate::processors::otp::get_otp;
611
use crate::processors::{mbi, objcopy};
7-
use anyhow::Context;
8-
use object::read::elf::ElfFile32;
9-
use std::path::PathBuf;
1012

1113
pub struct SignOutput {
1214
pub output_path: Option<PathBuf>,

bootloader-tool/src/config.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#![allow(unused)]
22

3-
use serde::Deserialize;
43
use std::path::{Path, PathBuf};
54

5+
use serde::Deserialize;
6+
67
#[derive(Deserialize, Debug)]
78
pub struct Config {
89
/// Path of the directory where artifacts are put and can be found.

bootloader-tool/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
pub use crate::config::Config;
2-
use clap::{Args, Parser, Subcommand};
31
use std::path::PathBuf;
42

3+
use clap::{Args, Parser, Subcommand};
4+
5+
pub use crate::config::Config;
6+
57
pub mod commands;
68
mod config;
79
pub mod processors;

bootloader-tool/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ async fn main() -> anyhow::Result<()> {
1111

1212
let cli = Cli::parse();
1313

14-
let config = Config::read(&cli.config)
15-
.with_context(|| format!("Tried to open --config {}", cli.config.display()))?;
14+
let config =
15+
Config::read(&cli.config).with_context(|| format!("Tried to open --config {}", cli.config.display()))?;
1616

1717
if let Some(command) = cli.commands {
1818
commands::process(&config, command).await

bootloader-tool/src/processors/certificates.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
1-
use std::{
2-
path::{Path, PathBuf},
3-
process::{Command, Stdio},
4-
};
1+
use std::path::{Path, PathBuf};
2+
use std::process::{Command, Stdio};
53

64
use anyhow::Context;
75
use serde::Serialize;
86

9-
use crate::{
10-
GenerateCertificatesArguments,
11-
config::{Certificate, CertificatePrototype, Config},
12-
util::{bytes_to_u32_le, generate_hex, parse_hex},
13-
};
7+
use crate::GenerateCertificatesArguments;
8+
use crate::config::{Certificate, CertificatePrototype, Config};
9+
use crate::util::{bytes_to_u32_le, generate_hex, parse_hex};
1410

1511
#[derive(Serialize)]
1612
struct BasicConstraints {

bootloader-tool/src/processors/mbi/cert_block.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
use std::{
2-
collections::BTreeMap,
3-
path::{Path, PathBuf},
4-
process::{Command, Stdio},
5-
};
1+
use std::collections::BTreeMap;
2+
use std::path::{Path, PathBuf};
3+
use std::process::{Command, Stdio};
64

75
use anyhow::Context;
8-
use rsa::{RsaPublicKey, pkcs1v15::VerifyingKey, pkcs8::DecodePublicKey, traits::PublicKeyParts};
6+
use rsa::RsaPublicKey;
7+
use rsa::pkcs1v15::VerifyingKey;
8+
use rsa::pkcs8::DecodePublicKey;
9+
use rsa::traits::PublicKeyParts;
910
use serde::Serialize;
1011
use sha2::{Digest, Sha256};
1112
use x509_parser::public_key::PublicKey;
1213

13-
use crate::{
14-
Config,
15-
processors::{certificates::Rkth, mbi::parse_x509_cert},
16-
};
14+
use crate::Config;
15+
use crate::processors::certificates::Rkth;
16+
use crate::processors::mbi::parse_x509_cert;
1717

1818
#[derive(Serialize)]
1919
#[serde(rename_all = "camelCase")]

0 commit comments

Comments
 (0)