Skip to content

Commit 9b1d269

Browse files
committed
Reformat with style_edition = "2024"
1 parent 8326083 commit 9b1d269

File tree

16 files changed

+44
-44
lines changed

16 files changed

+44
-44
lines changed

api/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ use std::io::{self, Read};
3535

3636
#[doc(no_inline)]
3737
pub use ed25519_dalek::{
38-
Signature, SignatureError, SigningKey, VerifyingKey, KEYPAIR_LENGTH, PUBLIC_KEY_LENGTH,
39-
SIGNATURE_LENGTH,
38+
KEYPAIR_LENGTH, PUBLIC_KEY_LENGTH, SIGNATURE_LENGTH, Signature, SignatureError, SigningKey,
39+
VerifyingKey,
4040
};
4141

4242
/// The unsigned hash of an input file

api/src/sign/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ mod zip;
88
use std::io::Read;
99

1010
#[cfg(feature = "sign-tar")]
11-
pub use self::tar::{copy_and_sign_tar, SignTarError};
11+
pub use self::tar::{SignTarError, copy_and_sign_tar};
1212
#[cfg(feature = "sign-zip")]
13-
pub use self::zip::{copy_and_sign_zip, SignZipError};
14-
use crate::constants::{SignatureCountLeInt, BUF_LIMIT, HEADER_SIZE, MAGIC_HEADER};
15-
use crate::{Prehash, SignatureError, SigningKey, KEYPAIR_LENGTH, SIGNATURE_LENGTH};
13+
pub use self::zip::{SignZipError, copy_and_sign_zip};
14+
use crate::constants::{BUF_LIMIT, HEADER_SIZE, MAGIC_HEADER, SignatureCountLeInt};
15+
use crate::{KEYPAIR_LENGTH, Prehash, SIGNATURE_LENGTH, SignatureError, SigningKey};
1616

1717
crate::Error! {
1818
/// An error returned by [`read_signing_keys()`]

api/src/sign/tar.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#![cfg_attr(docsrs, doc(cfg(feature = "sign-tar")))]
22

3-
use std::io::{copy, Read, Seek, Write};
3+
use std::io::{Read, Seek, Write, copy};
44

5-
use base64::prelude::BASE64_STANDARD;
65
use base64::Engine;
6+
use base64::prelude::BASE64_STANDARD;
77
use ed25519_dalek::SIGNATURE_LENGTH;
88

9-
use super::{gather_signature_data, GatherSignatureDataError};
9+
use super::{GatherSignatureDataError, gather_signature_data};
1010
use crate::constants::{
11-
SignatureCountLeInt, BUF_LIMIT, GZIP_END, GZIP_EXTRA, GZIP_START, HEADER_SIZE,
11+
BUF_LIMIT, GZIP_END, GZIP_EXTRA, GZIP_START, HEADER_SIZE, SignatureCountLeInt,
1212
};
1313
use crate::{Prehash, SigningKey};
1414

api/src/sign/zip.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
use std::io::{IoSlice, Read, Seek, SeekFrom, Write};
44

5-
use super::{gather_signature_data, GatherSignatureDataError};
6-
use crate::constants::{SignatureCountLeInt, BUF_LIMIT, HEADER_SIZE};
7-
use crate::sign_unsign_zip::{copy_zip, CopyZipError};
8-
use crate::{Prehash, SigningKey, SIGNATURE_LENGTH};
5+
use super::{GatherSignatureDataError, gather_signature_data};
6+
use crate::constants::{BUF_LIMIT, HEADER_SIZE, SignatureCountLeInt};
7+
use crate::sign_unsign_zip::{CopyZipError, copy_zip};
8+
use crate::{Prehash, SIGNATURE_LENGTH, SigningKey};
99

1010
crate::Error! {
1111
/// An error returned by [`copy_and_sign_zip()`]

api/src/unsign/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ mod tar;
66
mod zip;
77

88
#[cfg(feature = "unsign-tar")]
9-
pub use self::tar::{copy_and_unsign_tar, UnsignTarError};
9+
pub use self::tar::{UnsignTarError, copy_and_unsign_tar};
1010
#[cfg(feature = "unsign-zip")]
11-
pub use self::zip::{copy_and_unsign_zip, UnsignZipError};
11+
pub use self::zip::{UnsignZipError, copy_and_unsign_zip};

api/src/unsign/tar.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#![cfg_attr(docsrs, doc(cfg(feature = "unsign-tar")))]
22

3-
use std::io::{copy, Read, Seek, Write};
3+
use std::io::{Read, Seek, Write, copy};
44

55
use crate::verify_unsign_tar::{
6-
tar_find_data_start_and_len, tar_read_signatures, TarFindDataStartAndLenError,
7-
TarReadSignaturesError,
6+
TarFindDataStartAndLenError, TarReadSignaturesError, tar_find_data_start_and_len,
7+
tar_read_signatures,
88
};
99

1010
crate::Error! {

api/src/unsign/zip.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
use std::io::{Read, Seek, Write};
44

5-
use crate::sign_unsign_zip::{copy_zip, CopyZipError};
5+
use crate::sign_unsign_zip::{CopyZipError, copy_zip};
66

77
crate::Error! {
88
/// An error returned by [`copy_and_unsign_zip()`]

api/src/verify/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ mod zip;
88
use std::io::Read;
99

1010
#[cfg(feature = "verify-tar")]
11-
pub use self::tar::{verify_tar, VerifyTarError};
11+
pub use self::tar::{VerifyTarError, verify_tar};
1212
#[cfg(feature = "verify-zip")]
13-
pub use self::zip::{verify_zip, VerifyZipError};
14-
use crate::constants::{SignatureCountLeInt, BUF_LIMIT, HEADER_SIZE, MAGIC_HEADER};
13+
pub use self::zip::{VerifyZipError, verify_zip};
14+
use crate::constants::{BUF_LIMIT, HEADER_SIZE, MAGIC_HEADER, SignatureCountLeInt};
1515
use crate::{
16-
Prehash, Signature, SignatureError, VerifyingKey, PUBLIC_KEY_LENGTH, SIGNATURE_LENGTH,
16+
PUBLIC_KEY_LENGTH, Prehash, SIGNATURE_LENGTH, Signature, SignatureError, VerifyingKey,
1717
};
1818

1919
crate::Error! {

api/src/verify/tar.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
use std::io::{Read, Seek};
44

5-
use super::{find_match, NoMatch};
5+
use super::{NoMatch, find_match};
66
use crate::verify_unsign_tar::{
7-
tar_find_data_start_and_len, tar_read_signatures, TarFindDataStartAndLenError,
8-
TarReadSignaturesError,
7+
TarFindDataStartAndLenError, TarReadSignaturesError, tar_find_data_start_and_len,
8+
tar_read_signatures,
99
};
1010
use crate::{Prehash, VerifyingKey};
1111

api/src/verify/zip.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
use std::io::{Read, Seek};
44

5-
use super::{find_match, read_signatures, NoMatch, ReadSignaturesError, VerifyingKey};
5+
use super::{NoMatch, ReadSignaturesError, VerifyingKey, find_match, read_signatures};
66
use crate::{Prehash, Signature};
77

88
crate::Error! {

api/src/verify_unsign_tar.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
use std::io::{Read, Seek, SeekFrom};
22
use std::mem::size_of;
33

4-
use base64::prelude::BASE64_STANDARD;
54
use base64::Engine;
6-
use ed25519_dalek::{Signature, SignatureError, SIGNATURE_LENGTH};
5+
use base64::prelude::BASE64_STANDARD;
6+
use ed25519_dalek::{SIGNATURE_LENGTH, Signature, SignatureError};
77

88
use crate::constants::{
9-
SignatureCountLeInt, BUF_LIMIT, GZIP_END, GZIP_START, HEADER_SIZE, MAGIC_HEADER,
9+
BUF_LIMIT, GZIP_END, GZIP_START, HEADER_SIZE, MAGIC_HEADER, SignatureCountLeInt,
1010
};
1111

1212
#[derive(Debug, thiserror::Error)]

rustfmt.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ newline_style = "Unix"
88
normalize_doc_attributes = true
99
overflow_delimited_expr = true
1010
reorder_impl_items = true
11+
style_edition = "2024"
1112
unstable_features = true
1213
use_field_init_shorthand = true
1314
use_try_shorthand = true
14-
version = "Two"

src/generate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::os::unix::prelude::OpenOptionsExt;
55
use std::path::PathBuf;
66

77
use clap::Parser;
8-
use ed25519_dalek::{SigningKey, KEYPAIR_LENGTH};
8+
use ed25519_dalek::{KEYPAIR_LENGTH, SigningKey};
99
use rand_core::OsRng;
1010

1111
/// Generate a signing key

src/sign.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
use std::fs::{rename, File};
1+
use std::fs::{File, rename};
22
use std::io::Write;
33
use std::path::{Path, PathBuf};
44

55
use clap::{Args, Parser, Subcommand};
66
use normalize_path::NormalizePath;
7+
use zipsign_api::Prehash;
78
use zipsign_api::sign::{
8-
copy_and_sign_tar, copy_and_sign_zip, gather_signature_data, read_signing_keys,
9-
GatherSignatureDataError, ReadSigningKeysError, SignTarError, SignZipError,
9+
GatherSignatureDataError, ReadSigningKeysError, SignTarError, SignZipError, copy_and_sign_tar,
10+
copy_and_sign_zip, gather_signature_data, read_signing_keys,
1011
};
11-
use zipsign_api::Prehash;
1212

13-
use crate::{get_context, ImplicitContextError};
13+
use crate::{ImplicitContextError, get_context};
1414

1515
/// Generate signature for a file
1616
#[derive(Debug, Parser, Clone)]

src/unsign.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
use std::fs::{rename, File};
1+
use std::fs::{File, rename};
22
use std::path::{Path, PathBuf};
33

44
use clap::{Args, Parser, Subcommand};
55
use normalize_path::NormalizePath;
66
use zipsign_api::unsign::{
7-
copy_and_unsign_tar, copy_and_unsign_zip, UnsignTarError, UnsignZipError,
7+
UnsignTarError, UnsignZipError, copy_and_unsign_tar, copy_and_unsign_zip,
88
};
99

1010
/// Generate signature for a file

src/verify.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ use std::path::PathBuf;
44

55
use clap::{Args, Parser, Subcommand};
66
use zipsign_api::verify::{
7-
collect_keys, find_match, read_signatures, verify_tar, verify_zip, CollectKeysError, NoMatch,
8-
ReadSignaturesError, VerifyTarError, VerifyZipError,
7+
CollectKeysError, NoMatch, ReadSignaturesError, VerifyTarError, VerifyZipError, collect_keys,
8+
find_match, read_signatures, verify_tar, verify_zip,
99
};
10-
use zipsign_api::{Prehash, PUBLIC_KEY_LENGTH};
10+
use zipsign_api::{PUBLIC_KEY_LENGTH, Prehash};
1111

12-
use crate::{get_context, ImplicitContextError};
12+
use crate::{ImplicitContextError, get_context};
1313

1414
/// Verify a signature
1515
#[derive(Debug, Parser, Clone)]

0 commit comments

Comments
 (0)