Skip to content

Commit dc7be87

Browse files
Use Rust 2021 edition and bump dependencies (#17)
* Bump Rust edition to 2021 * Bump dependencies Only `clap` has a breaking change and required modifications.
1 parent 0671e8d commit dc7be87

File tree

3 files changed

+75
-69
lines changed

3 files changed

+75
-69
lines changed

Cargo.lock

Lines changed: 60 additions & 54 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@ name = "matched-data-cli"
33
version = "0.5.0"
44
authors = ["Miguel de Moura <mdemoura@cloudflare.com>"]
55
description = "Tool to interact with the firewall matched data feature"
6-
edition = "2018"
6+
edition = "2021"
77

88
[dependencies]
9-
assert_cmd = "2.0.0"
10-
assert_fs = "1.0.4"
11-
bincode = "1.3.1"
12-
clap = "3.0.0-beta.4"
9+
assert_cmd = "2.0.2"
10+
assert_fs = "1.0.6"
11+
bincode = "1.3.3"
12+
clap = "3.0.0-beta.5"
1313
generic-array = { version = "0.14.4", features = ["serde"] }
1414
hpke = { version = "0.7.1", default-features = false, features = [
1515
"x25519",
1616
"serde_impls",
1717
] }
1818
radix64 = "0.6.2"
19-
rand = "0.8.3"
20-
serde = { version = "1.0.117", features = ["derive"] }
21-
serde_json = "1.0.59"
19+
rand = "0.8.4"
20+
serde = { version = "1.0.130", features = ["derive"] }
21+
serde_json = "1.0.68"
2222

2323
[profile.release]
2424
lto = true

src/main.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@
33
mod matched_data;
44

55
use crate::matched_data::generate_key_pair;
6-
use clap::{ArgEnum, Clap};
6+
use clap::{ArgEnum, Parser};
77
use hpke::kex::Serializable;
88
use serde::{Deserialize, Serialize};
99
use std::io::{stdin, stdout, Write};
1010
use std::{fs, str};
1111

12-
#[derive(Clap)]
12+
#[derive(Parser)]
1313
#[clap(author, version)]
1414
struct Options {
1515
#[clap(subcommand)]
1616
command: Command,
1717
}
1818

19-
#[derive(ArgEnum)]
19+
#[derive(ArgEnum, Clone)]
2020
enum KeyPairOutputFormat {
2121
Json,
2222
}
2323

24-
#[derive(Clap)]
24+
#[derive(Parser)]
2525
struct GenerateKeyPairOptions {
2626
#[clap(
2727
arg_enum,
@@ -34,13 +34,13 @@ struct GenerateKeyPairOptions {
3434
output_format: KeyPairOutputFormat,
3535
}
3636

37-
#[derive(ArgEnum)]
37+
#[derive(ArgEnum, Clone)]
3838
enum DecryptOutputFormat {
3939
Raw,
4040
Utf8Lossy,
4141
}
4242

43-
#[derive(Clap)]
43+
#[derive(Parser)]
4444
struct DecryptOptions {
4545
#[clap(about = "File containing the base64 encoded encrypted matched data")]
4646
matched_data_filename: String,
@@ -63,7 +63,7 @@ struct DecryptOptions {
6363
output_format: DecryptOutputFormat,
6464
}
6565

66-
#[derive(Clap)]
66+
#[derive(Parser)]
6767
enum Command {
6868
/// Generates a public-private key pair
6969
GenerateKeyPair(GenerateKeyPairOptions),

0 commit comments

Comments
 (0)