Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ jobs:
id: rust_toolchain
uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
with:
toolchain: 1.96.1
toolchain: 1.97.0
targets: ${{ matrix.target }}
- name: Install musl-tools on Linux
run: sudo apt-get update --yes && sudo apt-get install --yes musl-tools
Expand Down Expand Up @@ -172,7 +172,7 @@ jobs:
id: rust_toolchain
uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
with:
toolchain: 1.96.1
toolchain: 1.97.0
- name: Authorize with crates.io
uses: rust-lang/crates-io-auth-action@c6f97d42243bad5fab37ca0427f495c86d5b1a18 # v1.0.5
id: auth
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/style.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Configure Rust
uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
with:
toolchain: 1.96.1
toolchain: 1.97.0
- name: Cache
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
Expand All @@ -51,7 +51,7 @@ jobs:
- name: Configure Rust
uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
with:
toolchain: 1.96.1
toolchain: 1.97.0
components: clippy
- name: Cache
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
Expand All @@ -71,7 +71,7 @@ jobs:
- name: Configure Rust
uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
with:
toolchain: 1.96.1
toolchain: 1.97.0
components: rustfmt
- run: cargo fmt --check

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
id: rust_toolchain
uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9
with:
toolchain: 1.96.1
toolchain: 1.97.0
- name: Cache
uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
Expand Down
4 changes: 2 additions & 2 deletions src/cli/cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub fn cluster<W: Write>(
}
} else {
info!("All cluster configurations:");
write!(output, "{}", &toml::to_string_pretty(&clusters)?)?;
write!(output, "{}", toml::to_string_pretty(&clusters)?)?;
}
} else {
let cluster = clusters.identify(options.cluster.as_deref())?;
Expand All @@ -49,7 +49,7 @@ pub fn cluster<W: Write>(
if args.short {
writeln!(output, "{}", cluster.name)?;
} else {
write!(output, "{}", &toml::to_string_pretty(&cluster)?)?;
write!(output, "{}", toml::to_string_pretty(&cluster)?)?;
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/cli/launchers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub fn launchers<W: Write>(
write!(
output,
"{}",
&toml::to_string_pretty(launchers.full_config())?
toml::to_string_pretty(launchers.full_config())?
)?;
} else {
let clusters = cluster::Configuration::open()?;
Expand All @@ -54,7 +54,7 @@ pub fn launchers<W: Write>(
write!(
output,
"{}",
&toml::to_string_pretty(&launchers.by_cluster(&cluster.name))?
toml::to_string_pretty(&launchers.by_cluster(&cluster.name))?
)?;
}
}
Expand Down
58 changes: 29 additions & 29 deletions src/cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ impl Configuration {
io::ErrorKind::NotFound => {
trace!(
"'{}' does not exist, using built-in clusters.",
&clusters_toml_path.display()
clusters_toml_path.display()
);
return Ok(clusters);
}
Expand All @@ -209,7 +209,7 @@ impl Configuration {
.read_to_string(&mut clusters_string)
.map_err(|e| Error::FileRead(clusters_toml_path.clone(), e))?;

trace!("Parsing '{}'.", &clusters_toml_path.display());
trace!("Parsing '{}'.", clusters_toml_path.display());
let user_config = Self::parse_str(&clusters_toml_path, &clusters_string)?;
clusters.merge(&user_config);
Ok(clusters)
Expand Down Expand Up @@ -647,62 +647,62 @@ mod tests {
..Resources::default()
};

assert!(
assert_eq!(
cluster
.find_partition(None, &cpu_resources, 1)
.unwrap()
.name
== "cpu"
.name,
"cpu"
);
assert!(
assert_eq!(
cluster
.find_partition(None, &cpu_resources, 10)
.unwrap()
.name
== "cpu"
.name,
"cpu"
);
assert!(
assert_eq!(
cluster
.find_partition(None, &gpu_resources, 1)
.unwrap()
.name
== "gpu"
.name,
"gpu"
);
assert!(
assert_eq!(
cluster
.find_partition(None, &gpu_resources, 10)
.unwrap()
.name
== "gpu"
.name,
"gpu"
);

assert!(
assert_eq!(
cluster
.find_partition(None, &cpu_resources, 11)
.unwrap()
.name
== "other"
.name,
"other"
);
assert!(
assert_eq!(
cluster
.find_partition(None, &gpu_resources, 11)
.unwrap()
.name
== "other"
.name,
"other"
);
assert!(
assert_eq!(
cluster
.find_partition(None, &cpu_resources, 20)
.unwrap()
.name
== "other"
.name,
"other"
);
assert!(
assert_eq!(
cluster
.find_partition(None, &gpu_resources, 20)
.unwrap()
.name
== "other"
.name,
"other"
);

assert!(matches!(
Expand All @@ -714,12 +714,12 @@ mod tests {
Err(Error::PartitionNameNotFound(_))
));

assert!(
assert_eq!(
cluster
.find_partition(Some("other"), &gpu_resources, 20)
.unwrap()
.name
== "other"
.name,
"other"
);
assert!(matches!(
cluster.find_partition(Some("other"), &cpu_resources, 21),
Expand Down
4 changes: 2 additions & 2 deletions src/launcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ impl Configuration {
io::ErrorKind::NotFound => {
trace!(
"'{}' does not exist, using built-in launchers.",
&launchers_toml_path.display()
launchers_toml_path.display()
);
return Ok(launchers);
}
Expand All @@ -131,7 +131,7 @@ impl Configuration {
.read_to_string(&mut launchers_string)
.map_err(|e| Error::FileRead(launchers_toml_path.clone(), e))?;

trace!("Parsing '{}'.", &launchers_toml_path.display());
trace!("Parsing '{}'.", launchers_toml_path.display());
let user_config = Self::parse_str(&launchers_toml_path, &launchers_string)?;
launchers.merge(user_config);
launchers.validate()?;
Expand Down
6 changes: 3 additions & 3 deletions src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,13 +140,13 @@ impl Table {
if i == row.len() - 1 {
item.text.clone()
} else {
format!("{:<width$}", &item.text, width = column_width[i])
format!("{:<width$}", item.text, width = column_width[i])
}
}
Alignment::Right => format!("{:>width$}", &item.text, width = column_width[i]),
Alignment::Right => format!("{:>width$}", item.text, width = column_width[i]),
};

write!(writer, "{}", &item.style.apply_to(text))?;
write!(writer, "{}", item.style.apply_to(text))?;
if i != row.len() - 1 {
write!(writer, " ")?;
}
Expand Down
2 changes: 1 addition & 1 deletion src/workflow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ impl Workflow {
.read_to_string(&mut workflow_string)
.map_err(|e| Error::FileRead(path.join("workflow.toml"), e))?;

trace!("Parsing '{}/workflow.toml'.", &path.display());
trace!("Parsing '{}/workflow.toml'.", path.display());
Self::open_str(&path, &workflow_string)
}

Expand Down