Skip to content

Commit

Permalink
Cleanups (Ralim#16)
Browse files Browse the repository at this point in the history
* Update deps

* Update cargo vet

* Increase optimisation in release mode, drop .idea folder

* updating errors

* drop this_error

* update deps
  • Loading branch information
Ralim authored Mar 3, 2024
1 parent 4298657 commit d39fe08
Show file tree
Hide file tree
Showing 11 changed files with 68 additions and 95 deletions.
1 change: 1 addition & 0 deletions bestool/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea/
8 changes: 0 additions & 8 deletions bestool/.idea/.gitignore

This file was deleted.

11 changes: 0 additions & 11 deletions bestool/.idea/bestool.iml

This file was deleted.

8 changes: 0 additions & 8 deletions bestool/.idea/modules.xml

This file was deleted.

6 changes: 0 additions & 6 deletions bestool/.idea/vcs.xml

This file was deleted.

49 changes: 24 additions & 25 deletions bestool/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion bestool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ edition = "2021"
[dependencies]
serialport = "4.2.2"
clap = { version = "4.4.8", features = ["derive"] }
thiserror = "1.0.50"
tracing = "0.1.40"
tracing-subscriber = "0.3.18"
crc = "3.0.1"


[profile.release]
lto = "fat"
build-override.codegen-units = 1
20 changes: 10 additions & 10 deletions bestool/src/beslink/errors.rs
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
use thiserror::Error;

#[derive(Error, Debug)]
#[derive(Debug)]
pub enum BESLinkError {
#[error("IOError")]
IOError(#[from] std::io::Error),
#[error("SerialPortError")]
SerialPortError(#[from] serialport::Error),
#[error("BadChecksumError Bad checksum; got {got:?} wanted {wanted:?} : {failed_packet:X?}")]
IOError {
e: std::io::Error,
},
BadChecksumError {
failed_packet: Vec<u8>,
got: u8,
wanted: u8,
},
#[error("BadResponseCode Bad result; got {got:?} wanted {wanted:?} : {failed_packet:X?}")]
BadResponseCode {
failed_packet: Vec<u8>,
got: u8,
wanted: u8,
},
#[error("Invalid Argument")]
InvalidArgs,
// #[error("Communications timed out")]
// Timeout,
}

impl From<std::io::Error> for BESLinkError {
fn from(value: std::io::Error) -> Self {
Self::IOError { e: value }
}
}
5 changes: 1 addition & 4 deletions bestool/src/beslink/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,10 @@ pub fn sync(
}
}
Err(e) => match e {
BESLinkError::IOError(_) => return Err(e),
BESLinkError::SerialPortError(_) => return Err(e),
BESLinkError::BadChecksumError { .. } => {
warn!("Ignoring bad checksum; you might not be in programmer mode.")
}
BESLinkError::BadResponseCode { .. } => return Err(e),
BESLinkError::InvalidArgs => return Err(e),
_ => return Err(e),
},
}
}
Expand Down
5 changes: 5 additions & 0 deletions bestool/supply-chain/audits.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ who = "Ben V. Brown <[email protected]>"
criteria = "safe-to-deploy"
version = "0.4.0"

[[audits.log]]
who = "Ben V. Brown <[email protected]>"
criteria = "safe-to-deploy"
delta = "0.4.20 -> 0.4.21"

[[audits.pkg-config]]
who = "Ben V. Brown <[email protected]>"
criteria = "safe-to-deploy"
Expand Down
44 changes: 22 additions & 22 deletions bestool/supply-chain/imports.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ user-login = "BurntSushi"
user-name = "Andrew Gallant"

[[publisher.anstream]]
version = "0.6.11"
when = "2024-01-18"
version = "0.6.13"
when = "2024-02-27"
user-id = 6743
user-login = "epage"
user-name = "Ed Page"
Expand Down Expand Up @@ -156,8 +156,8 @@ user-login = "mbrubeck"
user-name = "Matt Brubeck"

[[publisher.syn]]
version = "2.0.49"
when = "2024-02-16"
version = "2.0.52"
when = "2024-02-28"
user-id = 3618
user-login = "dtolnay"
user-name = "David Tolnay"
Expand All @@ -177,8 +177,8 @@ user-login = "dtolnay"
user-name = "David Tolnay"

[[publisher.thread_local]]
version = "1.1.7"
when = "2023-02-12"
version = "1.1.8"
when = "2024-02-20"
user-id = 2915
user-login = "Amanieu"
user-name = "Amanieu d'Antras"
Expand All @@ -205,57 +205,57 @@ user-login = "kennykerr"
user-name = "Kenny Kerr"

[[publisher.windows-targets]]
version = "0.52.0"
when = "2023-11-15"
version = "0.52.4"
when = "2024-02-28"
user-id = 64539
user-login = "kennykerr"
user-name = "Kenny Kerr"

[[publisher.windows_aarch64_gnullvm]]
version = "0.52.0"
when = "2023-11-15"
version = "0.52.4"
when = "2024-02-28"
user-id = 64539
user-login = "kennykerr"
user-name = "Kenny Kerr"

[[publisher.windows_aarch64_msvc]]
version = "0.52.0"
when = "2023-11-15"
version = "0.52.4"
when = "2024-02-28"
user-id = 64539
user-login = "kennykerr"
user-name = "Kenny Kerr"

[[publisher.windows_i686_gnu]]
version = "0.52.0"
when = "2023-11-15"
version = "0.52.4"
when = "2024-02-28"
user-id = 64539
user-login = "kennykerr"
user-name = "Kenny Kerr"

[[publisher.windows_i686_msvc]]
version = "0.52.0"
when = "2023-11-15"
version = "0.52.4"
when = "2024-02-28"
user-id = 64539
user-login = "kennykerr"
user-name = "Kenny Kerr"

[[publisher.windows_x86_64_gnu]]
version = "0.52.0"
when = "2023-11-15"
version = "0.52.4"
when = "2024-02-28"
user-id = 64539
user-login = "kennykerr"
user-name = "Kenny Kerr"

[[publisher.windows_x86_64_gnullvm]]
version = "0.52.0"
when = "2023-11-15"
version = "0.52.4"
when = "2024-02-28"
user-id = 64539
user-login = "kennykerr"
user-name = "Kenny Kerr"

[[publisher.windows_x86_64_msvc]]
version = "0.52.0"
when = "2023-11-15"
version = "0.52.4"
when = "2024-02-28"
user-id = 64539
user-login = "kennykerr"
user-name = "Kenny Kerr"
Expand Down

0 comments on commit d39fe08

Please sign in to comment.