Skip to content

Commit

Permalink
fix: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
skyf0l committed Feb 9, 2024
1 parent 6eea9f1 commit 806e727
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ fn main() -> Result<(), MainError> {
if args.public {
if let Some(n) = &params.n {
let rsa = openssl::rsa::Rsa::from_public_components(
openssl::bn::BigNum::from_slice(&integer_to_digits(&n)).unwrap(),
openssl::bn::BigNum::from_slice(&integer_to_digits(n)).unwrap(),
openssl::bn::BigNum::from_slice(&integer_to_digits(&params.e)).unwrap(),
)
.or(Err("Invalid public key parameters"))?;
Expand Down
4 changes: 2 additions & 2 deletions src/ntheory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub fn rational_to_contfrac(x: &Integer, y: &Integer) -> Vec<Integer> {
}
}

pub fn contfrac_to_rational(frac: &Vec<Integer>) -> (Integer, Integer) {
pub fn contfrac_to_rational(frac: &[Integer]) -> (Integer, Integer) {
if frac.is_empty() {
(0.into(), 1.into())
} else if frac.len() == 1 {
Expand All @@ -28,7 +28,7 @@ pub fn contfrac_to_rational(frac: &Vec<Integer>) -> (Integer, Integer) {
}

#[allow(dead_code)]
pub fn convergents_from_contfrac(frac: &Vec<Integer>) -> Vec<(Integer, Integer)> {
pub fn convergents_from_contfrac(frac: &[Integer]) -> Vec<(Integer, Integer)> {
let mut convs = Vec::new();

for i in 0..frac.len() {
Expand Down

0 comments on commit 806e727

Please sign in to comment.