Skip to content

Commit 23532c9

Browse files
committed
libazureinit: lower the minimum Rust version
Replace inspect_err with map_err, to lower the minimum Rust version from 1.76, which is apparently not wide-spread enough in other development environments. See also Azure#84 (review).
1 parent eb758bf commit 23532c9

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

libazureinit/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
name = "libazureinit"
33
version = "0.1.1"
44
edition = "2021"
5-
rust-version = "1.76"
65
build = "build.rs"
76
repository = "https://github.com/Azure/azure-init/"
87
homepage = "https://github.com/Azure/azure-init/"

libazureinit/src/media.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -193,16 +193,18 @@ pub fn parse_ovf_env(ovf_body: &str) -> Result<Environment, Error> {
193193
pub fn mount_parse_ovf_env(dev: String) -> Result<Environment, Error> {
194194
let mount_media =
195195
Media::new(PathBuf::from(dev), PathBuf::from(PATH_MOUNT_POINT));
196-
let mounted = mount_media.mount().inspect_err(
197-
|e| tracing::error!(error = ?e, "Failed to mount media."),
198-
)?;
196+
let mounted = mount_media.mount().map_err(|e| {
197+
tracing::error!(error = ?e, "Failed to mount media.");
198+
e
199+
})?;
199200

200201
let ovf_body = mounted.read_ovf_env_to_string()?;
201202
let environment = parse_ovf_env(ovf_body.as_str())?;
202203

203-
mounted.unmount().inspect_err(
204-
|e| tracing::error!(error = ?e, "Failed to remove media."),
205-
)?;
204+
mounted.unmount().map_err(|e| {
205+
tracing::error!(error = ?e, "Failed to remove media.");
206+
e
207+
})?;
206208

207209
Ok(environment)
208210
}

0 commit comments

Comments
 (0)