Skip to content

Commit

Permalink
Merge pull request #73 from alanssitis/update-fmt
Browse files Browse the repository at this point in the history
Update rustfmt max width to 80
  • Loading branch information
adityasaky authored Nov 6, 2023
2 parents f0532d9 + 944d15b commit 297340a
Show file tree
Hide file tree
Showing 32 changed files with 1,113 additions and 490 deletions.
7 changes: 7 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Ignore calls to `cargo fmt`
#
# To learn more, see
# https://docs.github.com/en/repositories/working-with-files/using-files/viewing-a-file#ignore-commits-in-the-blame-view

# Run cargo fmt changing max width to 80
e66afe2850768076ce4f4c5f101e9dcc61697ba2
3 changes: 2 additions & 1 deletion examples/in_toto_run_test.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use in_toto::crypto::PrivateKey;
use in_toto::runlib::in_toto_run;

const ED25519_1_PRIVATE_KEY: &'static [u8] = include_bytes!("../tests/ed25519/ed25519-1");
const ED25519_1_PRIVATE_KEY: &'static [u8] =
include_bytes!("../tests/ed25519/ed25519-1");

fn main() {
let key = PrivateKey::from_ed25519(ED25519_1_PRIVATE_KEY).unwrap();
Expand Down
6 changes: 4 additions & 2 deletions examples/serialize_keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ use std::os::unix::fs::OpenOptionsExt;
fn main() {
// Generate a new Ed25519 signing key
let key = PrivateKey::new(KeyType::Ed25519).unwrap();
let mut privkey = PrivateKey::from_pkcs8(&key, SignatureScheme::Ed25519).unwrap();
let mut privkey =
PrivateKey::from_pkcs8(&key, SignatureScheme::Ed25519).unwrap();
println!("Generated keypair {:?}", &privkey.public());

let mut target = OpenOptions::new()
Expand All @@ -19,7 +20,8 @@ fn main() {
target.write_all(&key).unwrap();

let loaded_key = fs::read("test-key").unwrap();
privkey = PrivateKey::from_pkcs8(&loaded_key, SignatureScheme::Ed25519).unwrap();
privkey =
PrivateKey::from_pkcs8(&loaded_key, SignatureScheme::Ed25519).unwrap();

println!("loaded keypair: {:?}", &privkey.public())
}
3 changes: 2 additions & 1 deletion examples/write_link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ fn main() {
// Generate a new Ed25519 signing key
let key = PrivateKey::new(KeyType::Ed25519).unwrap();
println!("Generated keypair: {:?}", key);
let privkey = PrivateKey::from_pkcs8(&key, SignatureScheme::Ed25519).unwrap();
let privkey =
PrivateKey::from_pkcs8(&key, SignatureScheme::Ed25519).unwrap();

let link = LinkMetadataBuilder::new()
.name(String::from("test"))
Expand Down
1 change: 1 addition & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
edition = "2018"
max_width = 80
Loading

0 comments on commit 297340a

Please sign in to comment.