Skip to content

Commit c58a383

Browse files
committed
chore: bump rust edition to 2024
Signed-off-by: Jan Zachmann <[email protected]>
1 parent bc4d78d commit c58a383

File tree

2 files changed

+33
-39
lines changed

2 files changed

+33
-39
lines changed

Cargo.toml

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11
[package]
22
authors = ["[email protected]>"]
33
description = "Basic wrapper around azure identity service."
4-
edition = "2021"
4+
edition = "2024"
55
license = "MIT OR Apache-2.0"
66
name = "eis-utils"
77
repository = "https://github.com/omnect/eis-utils"
8-
version = "0.3.3"
9-
10-
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
8+
version = "0.3.4"
119

1210
[dependencies]
13-
aziot-cert-client-async = { git = "https://github.com/Azure/iot-identity-service.git", package = "aziot-cert-client-async", tag = "1.5.0" }
14-
aziot-cert-common = { git = "https://github.com/Azure/iot-identity-service.git", package = "aziot-cert-common", tag = "1.5.0" }
15-
aziot-certd-config = { git = "https://github.com/Azure/iot-identity-service.git", package = "aziot-certd-config", tag = "1.5.0" }
16-
aziot-cert-common-http = { git = "https://github.com/Azure/iot-identity-service.git", package = "aziot-cert-common-http", tag = "1.5.0" }
17-
aziot-identity-client-async = { git = "https://github.com/Azure/iot-identity-service.git", package = "aziot-identity-client-async", tag = "1.5.0" }
18-
aziot-identity-common = { git = "https://github.com/Azure/iot-identity-service.git", package = "aziot-identity-common", tag = "1.5.0" }
19-
aziot-identityd-config = { git = "https://github.com/Azure/iot-identity-service.git", package = "aziot-identityd-config", tag = "1.5.0" }
20-
aziot-identity-common-http = { git = "https://github.com/Azure/iot-identity-service.git", package = "aziot-identity-common-http", tag = "1.5.0" }
21-
aziot-keyd-config = { git = "https://github.com/Azure/iot-identity-service.git", package = "aziot-keyd-config", tag = "1.5.0" }
22-
aziot-key-client-async = { git = "https://github.com/Azure/iot-identity-service.git", package = "aziot-key-client-async", tag = "1.5.0" }
23-
aziot-key-common = { git = "https://github.com/Azure/iot-identity-service.git", package = "aziot-key-common", tag = "1.5.0" }
24-
aziot-key-common-http = { git = "https://github.com/Azure/iot-identity-service.git", package = "aziot-key-common-http", tag = "1.5.0" }
25-
base64 = "0.22"
26-
# ToDo: check if 'default-features = false' can be removed. currently needed as workaround for cargo-bitbake.
11+
aziot-cert-client-async = { git = "https://github.com/Azure/iot-identity-service.git", package = "aziot-cert-client-async", tag = "1.5.5" }
12+
aziot-cert-common = { git = "https://github.com/Azure/iot-identity-service.git", package = "aziot-cert-common", tag = "1.5.5" }
13+
aziot-certd-config = { git = "https://github.com/Azure/iot-identity-service.git", package = "aziot-certd-config", tag = "1.5.5" }
14+
aziot-cert-common-http = { git = "https://github.com/Azure/iot-identity-service.git", package = "aziot-cert-common-http", tag = "1.5.5" }
15+
aziot-identity-client-async = { git = "https://github.com/Azure/iot-identity-service.git", package = "aziot-identity-client-async", tag = "1.5.5" }
16+
aziot-identity-common = { git = "https://github.com/Azure/iot-identity-service.git", package = "aziot-identity-common", tag = "1.5.5" }
17+
aziot-identityd-config = { git = "https://github.com/Azure/iot-identity-service.git", package = "aziot-identityd-config", tag = "1.5.5" }
18+
aziot-identity-common-http = { git = "https://github.com/Azure/iot-identity-service.git", package = "aziot-identity-common-http", tag = "1.5.5" }
19+
aziot-keyd-config = { git = "https://github.com/Azure/iot-identity-service.git", package = "aziot-keyd-config", tag = "1.5.5" }
20+
aziot-key-client-async = { git = "https://github.com/Azure/iot-identity-service.git", package = "aziot-key-client-async", tag = "1.5.5" }
21+
aziot-key-common = { git = "https://github.com/Azure/iot-identity-service.git", package = "aziot-key-common", tag = "1.5.5" }
22+
aziot-key-common-http = { git = "https://github.com/Azure/iot-identity-service.git", package = "aziot-key-common-http", tag = "1.5.5" }
23+
base64 = { version = "0.22", default-features = false }
2724
env_logger = { version = "0.11", default-features = false }
28-
http-common = { git = "https://github.com/Azure/iot-identity-service.git", package = "http-common", tag = "1.5.0" }
29-
hyper-timeout = "0.5"
30-
log = "0.4"
31-
percent-encoding = "2.1"
32-
tokio = { version = "1", features = ["full", "rt-multi-thread"] }
33-
url = "2.2"
25+
http-common = { git = "https://github.com/Azure/iot-identity-service.git", default-features = false, package = "http-common", tag = "1.5.5" }
26+
hyper-timeout = { version = "0.5", default-features = false }
27+
log = { version = "0.4", default-features = false }
28+
percent-encoding = { version = "2.3", default-features = false }
29+
tokio = { version = "1", default-features = false, features = [
30+
"full",
31+
"rt-multi-thread",
32+
] }
33+
url = { version = "2.5", default-features = false }
3434

3535
[dev-dependencies]
3636
async-trait = "0.1"
@@ -39,7 +39,7 @@ http = "0.2"
3939
hyper = "0.14"
4040
futures-util = "0.3"
4141
serde_json = "1"
42-
config-common = { git = "https://github.com/Azure/iot-identity-service.git", package = "config-common", tag = "1.5.0" }
42+
config-common = { git = "https://github.com/Azure/iot-identity-service.git", package = "config-common", tag = "1.5.5" }
4343
toml = "0.8"
44-
lazy_static = "1.4"
45-
regex = "1.5"
44+
lazy_static = "1.5"
45+
regex = "1.11"

src/lib.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ pub async fn request_connection_string_from_eis_with_expiry(
3939
.duration_since(std::time::UNIX_EPOCH)
4040
.unwrap()
4141
{
42-
return Err(std::io::Error::new(
43-
std::io::ErrorKind::Other,
42+
return Err(std::io::Error::other(
4443
"Invalid expiry, needs to be in the future.".to_string(),
4544
));
4645
}
@@ -60,8 +59,7 @@ pub async fn request_connection_string_from_eis_with_expiry(
6059
let spec = match identity {
6160
aziot_identity_common::Identity::Aziot(i) => i,
6261
_ => {
63-
return Err(std::io::Error::new(
64-
std::io::ErrorKind::Other,
62+
return Err(std::io::Error::other(
6563
format!("Invalid identity type {:?}.", identity),
6664
));
6765
}
@@ -84,17 +82,15 @@ pub async fn request_connection_string_from_eis_with_expiry(
8482
let auth = match spec.auth {
8583
Some(a) => a,
8684
_ => {
87-
return Err(std::io::Error::new(
88-
std::io::ErrorKind::Other,
85+
return Err(std::io::Error::other(
8986
"Missing auth.".to_string(),
9087
));
9188
}
9289
};
9390
let key = match auth.key_handle {
9491
Some(k) => k,
9592
_ => {
96-
return Err(std::io::Error::new(
97-
std::io::ErrorKind::Other,
93+
return Err(std::io::Error::other(
9894
"Missing auth key handle.".to_string(),
9995
));
10096
}
@@ -117,8 +113,7 @@ pub async fn request_connection_string_from_eis_with_expiry(
117113
let cert_id = match auth.cert_id {
118114
Some(c) => c,
119115
_ => {
120-
return Err(std::io::Error::new(
121-
std::io::ErrorKind::Other,
116+
return Err(std::io::Error::other(
122117
"Missing auth cert id.".to_string(),
123118
));
124119
}
@@ -136,8 +131,7 @@ pub async fn request_connection_string_from_eis_with_expiry(
136131
}
137132
}
138133
_ => {
139-
return Err(std::io::Error::new(
140-
std::io::ErrorKind::Other,
134+
return Err(std::io::Error::other(
141135
format!("Invalid auth type {:?}.", auth.auth_type),
142136
));
143137
}

0 commit comments

Comments
 (0)