Skip to content

Commit 8a833b1

Browse files
committed
clip fmt
1 parent 649ee27 commit 8a833b1

File tree

2 files changed

+23
-10
lines changed

2 files changed

+23
-10
lines changed

orchestrator/src/coordinator.rs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,10 @@ async fn modify_cargo_toml(
314314
let read_request = ReadFileRequest {
315315
path: PATH.to_owned(),
316316
};
317-
let cargo_toml = commander.one(read_request).await.context(CouldNotReadSnafu)?;
317+
let cargo_toml = commander
318+
.one(read_request)
319+
.await
320+
.context(CouldNotReadSnafu)?;
318321

319322
let cargo_toml = String::from_utf8(cargo_toml.0)?;
320323
let cargo_toml = toml::from_str(&cargo_toml)?;
@@ -328,7 +331,10 @@ async fn modify_cargo_toml(
328331
path: PATH.to_owned(),
329332
content: cargo_toml,
330333
};
331-
commander.one(write_request).await.context(CouldNotWriteSnafu)?;
334+
commander
335+
.one(write_request)
336+
.await
337+
.context(CouldNotWriteSnafu)?;
332338

333339
Ok(())
334340
}
@@ -592,7 +598,7 @@ impl Backend for DockerBackend {
592598
}
593599

594600
impl Channel {
595-
fn to_container_name(&self) -> &'static str {
601+
fn to_container_name(self) -> &'static str {
596602
match self {
597603
Channel::Stable => "orchestrator-stable",
598604
Channel::Beta => "orchestrator-beta",
@@ -1008,7 +1014,10 @@ mod tests {
10081014
.unwrap();
10091015

10101016
assert!(response.success, "stderr: {}", response.stderr);
1011-
assert_contains!(response.code, r#"(func $inc (export "inc") (type $t0) (param $p0 i32) (result i32)"#);
1017+
assert_contains!(
1018+
response.code,
1019+
r#"(func $inc (export "inc") (type $t0) (param $p0 i32) (result i32)"#
1020+
);
10121021

10131022
coordinator.shutdown().await?;
10141023

orchestrator/src/sandbox.rs

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ impl Channel {
3939
pub(crate) const ALL: [Self; 3] = [Self::Stable, Self::Beta, Self::Nightly];
4040

4141
#[cfg(test)]
42-
pub(crate) fn to_str(&self) -> &'static str {
42+
pub(crate) fn to_str(self) -> &'static str {
4343
match self {
4444
Channel::Stable => "stable",
4545
Channel::Beta => "beta",
@@ -65,15 +65,15 @@ impl Edition {
6565
#[cfg(test)]
6666
pub(crate) const ALL: [Self; 3] = [Self::Rust2015, Self::Rust2018, Self::Rust2021];
6767

68-
pub(crate) fn to_str(&self) -> &'static str {
68+
pub(crate) fn to_str(self) -> &'static str {
6969
match self {
7070
Edition::Rust2015 => "2015",
7171
Edition::Rust2018 => "2018",
7272
Edition::Rust2021 => "2021",
7373
}
7474
}
7575

76-
pub(crate) fn to_cargo_toml_key(&self) -> &'static str {
76+
pub(crate) fn to_cargo_toml_key(self) -> &'static str {
7777
self.to_str()
7878
}
7979
}
@@ -85,7 +85,7 @@ pub enum CrateType {
8585
}
8686

8787
impl CrateType {
88-
pub(crate) fn to_cargo_toml_key(&self) -> &'static str {
88+
pub(crate) fn to_cargo_toml_key(self) -> &'static str {
8989
use {CrateType::*, LibraryType::*};
9090

9191
match self {
@@ -99,8 +99,12 @@ impl CrateType {
9999
}
100100
}
101101

102-
pub(crate) fn to_library_cargo_toml_key(&self) -> Option<&'static str> {
103-
if *self == Self::Binary { None } else { Some(self.to_cargo_toml_key()) }
102+
pub(crate) fn to_library_cargo_toml_key(self) -> Option<&'static str> {
103+
if self == Self::Binary {
104+
None
105+
} else {
106+
Some(self.to_cargo_toml_key())
107+
}
104108
}
105109
}
106110

0 commit comments

Comments
 (0)