summaryrefslogtreecommitdiffstats
path: root/crates
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2021-10-26 17:30:11 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2021-10-26 17:30:11 +0200
commit8bebe4c76107d8b0a55fda238b0475469d374d77 (patch)
treef16f7ea339af3c442e5daddf9c6ba0c8119a1a29 /crates
parente57b743058836ef34d4dd96fca5d6152f910140c (diff)
downloadrebel-8bebe4c76107d8b0a55fda238b0475469d374d77.tar
rebel-8bebe4c76107d8b0a55fda238b0475469d374d77.zip
Switch to 2021 edition
Diffstat (limited to 'crates')
-rw-r--r--crates/common/Cargo.toml2
-rw-r--r--crates/executor/Cargo.toml2
-rw-r--r--crates/executor/src/args.rs1
-rw-r--r--crates/executor/src/context.rs6
-rw-r--r--crates/runner/Cargo.toml2
-rw-r--r--crates/runner/src/init.rs8
-rw-r--r--crates/runner/src/lib.rs4
7 files changed, 13 insertions, 12 deletions
diff --git a/crates/common/Cargo.toml b/crates/common/Cargo.toml
index 2d5b70d..954ebe5 100644
--- a/crates/common/Cargo.toml
+++ b/crates/common/Cargo.toml
@@ -3,7 +3,7 @@ name = "rebel-common"
version = "0.1.0"
authors = ["Matthias Schiffer <mschiffer@universe-factory.net>"]
license = "MIT"
-edition = "2018"
+edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
diff --git a/crates/executor/Cargo.toml b/crates/executor/Cargo.toml
index 867a9f4..821caa7 100644
--- a/crates/executor/Cargo.toml
+++ b/crates/executor/Cargo.toml
@@ -3,7 +3,7 @@ name = "rebel"
version = "0.1.0"
authors = ["Matthias Schiffer <mschiffer@universe-factory.net>"]
license = "MIT"
-edition = "2018"
+edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
diff --git a/crates/executor/src/args.rs b/crates/executor/src/args.rs
index 527231d..510a156 100644
--- a/crates/executor/src/args.rs
+++ b/crates/executor/src/args.rs
@@ -1,7 +1,6 @@
use std::{
collections::{hash_map, HashMap},
hash,
- iter::FromIterator,
rc::Rc,
};
diff --git a/crates/executor/src/context.rs b/crates/executor/src/context.rs
index 7a46e8d..8951c50 100644
--- a/crates/executor/src/context.rs
+++ b/crates/executor/src/context.rs
@@ -3,7 +3,6 @@ use std::{
collections::{HashMap, HashSet},
fmt::Display,
hash::Hash,
- iter::FromIterator,
ops::Index,
rc::Rc,
result,
@@ -146,7 +145,7 @@ pub struct Context {
impl Context {
pub fn new(tasks: HashMap<TaskID, TaskDef>) -> Self {
- let platforms: HashMap<_, _> = IntoIterator::into_iter([
+ let platforms: HashMap<_, _> = [
arg(
"build",
args::Platform {
@@ -165,7 +164,8 @@ impl Context {
prefix: "/usr".to_string(),
},
),
- ])
+ ]
+ .into_iter()
.collect();
let globals = TaskArgs::from_iter([
diff --git a/crates/runner/Cargo.toml b/crates/runner/Cargo.toml
index b69e51e..5d51739 100644
--- a/crates/runner/Cargo.toml
+++ b/crates/runner/Cargo.toml
@@ -3,7 +3,7 @@ name = "rebel-runner"
version = "0.1.0"
authors = ["Matthias Schiffer <mschiffer@universe-factory.net>"]
license = "MIT"
-edition = "2018"
+edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
diff --git a/crates/runner/src/init.rs b/crates/runner/src/init.rs
index 783faf4..b2ebbe3 100644
--- a/crates/runner/src/init.rs
+++ b/crates/runner/src/init.rs
@@ -14,23 +14,23 @@ fn prepare_rootfs(rootfs: &str) -> Result<()> {
mount::mount::<_, _, str, str>(Some(rootfs), rootfs, None, MsFlags::MS_BIND, None)
.context("Failed to bind mount container rootfs")?;
- for dir in IntoIterator::into_iter(["pts", "shm"]) {
+ for dir in ["pts", "shm"] {
fs::mkdir(paths::join(&[rootfs, "dev", dir]))?;
}
- for (link, target) in IntoIterator::into_iter([
+ for (link, target) in [
("fd", "/proc/self/fd"),
("stdin", "/proc/self/fd/0"),
("stdout", "/proc/self/fd/1"),
("stderr", "/proc/self/fd/2"),
("ptmx", "pts/ptmx"),
- ]) {
+ ] {
let path = paths::join(&[rootfs, "dev", link]);
std::os::unix::fs::symlink(target, &path)
.with_context(|| format!("Failed to create link {}", path))?;
}
- for dev in IntoIterator::into_iter(["null", "zero", "full", "random", "urandom", "tty"]) {
+ for dev in ["null", "zero", "full", "random", "urandom", "tty"] {
let source = paths::join(&["/dev", dev]);
let target = paths::join(&[rootfs, "dev", dev]);
fs::create(&target)?;
diff --git a/crates/runner/src/lib.rs b/crates/runner/src/lib.rs
index d0d8317..21289cf 100644
--- a/crates/runner/src/lib.rs
+++ b/crates/runner/src/lib.rs
@@ -119,7 +119,9 @@ pub struct Runner {
impl Runner {
/// Creates a new container runner
///
- /// Unsafe: Do not call in multithreaded processes
+ /// # Safety
+ ///
+ /// Do not call in multithreaded processes.
pub unsafe fn new(options: &Options) -> Result<Self> {
let lockfile = unix::lock(paths::LOCKFILE, true, false)
.context("Failed to get lock on build directory, is another instance running?")?;