From cdce0eb872dfc142df1c1afb79a117e864dbb288 Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Tue, 12 Apr 2022 13:12:03 +0200 Subject: [PATCH] mounts: Use a more sensible field name for Mounts vec is...weird. Signed-off-by: Samuel Ortiz --- container/src/mounts.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/container/src/mounts.rs b/container/src/mounts.rs index 3323d74..f052b79 100644 --- a/container/src/mounts.rs +++ b/container/src/mounts.rs @@ -12,7 +12,7 @@ struct Mount { #[derive(Clone)] pub struct Mounts { - vec: Vec, + mounts: Vec, } impl Mounts { @@ -20,7 +20,7 @@ impl Mounts { /// This method should be called before the container process execution in order to prepare /// & mount every mounts defined for it. pub fn apply(&self) -> Result<(), std::io::Error> { - for mount in &self.vec { + for mount in &self.mounts { if let Some(code) = Command::new("mount") .args(["-t", &mount.typ, &mount.source, &mount.destination]) .status()? @@ -37,7 +37,7 @@ impl Mounts { /// Cleanup the mounts of a rootfs. /// This method should be called when a container has ended, to clean up the FS. pub fn cleanup(&self, rootfs: PathBuf) -> Result<(), crate::Error> { - for mount in &self.vec { + for mount in &self.mounts { let mut path = rootfs.clone(); path.push(&mount.source); @@ -64,7 +64,7 @@ impl Default for Mounts { /// Based on the OCI Specification fn default() -> Self { Mounts { - vec: vec![ + mounts: vec![ Mount { typ: String::from("devtmpfs"), source: String::from("dev"),