Skip to content

Commit

Permalink
Minor: Restore compatibility with Rust 1.52
Browse files Browse the repository at this point in the history
  • Loading branch information
soulsource committed Jan 20, 2023
1 parent 212f20c commit 283313e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "passwordmaker-rs"
version = "0.2.0"
version = "0.2.1"
edition = "2018"
authors = ["Andreas Grois"]
rust-version = "1.52"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ impl<const N : usize> TryFrom<&ArbitraryBytes<N>> for usize{
Err(ArbitraryBytesToUsizeError)
} else {
//failing to get last_bit is an actual error.
let last_bit = value.0.get(N-1).ok_or(ArbitraryBytesToUsizeError).copied();
let last_bit = value.0.get(N-1).copied().ok_or(ArbitraryBytesToUsizeError);
//second-last is not an error though.
let second_last_bit = value.0.get(N-2).copied().unwrap_or_default();
#[allow(clippy::cast_possible_truncation)] //false positive. This function is only compiled on 64bit systems.
Expand Down

0 comments on commit 283313e

Please sign in to comment.