Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
trxcllnt committed Aug 16, 2024
1 parent c1dbaf8 commit 2b06902
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ zip = { version = "0.6", default-features = false }
zstd = "0.13"

# dist-server only
itertools = "0.12"
memmap2 = "0.9.4"
nix = { version = "0.28.0", optional = true, features = [
"mount",
Expand All @@ -118,10 +119,9 @@ object = "0.32"
rouille = { version = "3.6", optional = true, default-features = false, features = [
"ssl",
] }
shlex = "=1.3.0"
syslog = { version = "6", optional = true }
version-compare = { version = "0.1.1", optional = true }
shlex = "=1.3.0"
itertools = "0.12"

[dev-dependencies]
assert_cmd = "2.0.13"
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/cicc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ pub async fn preprocess(cwd: &Path, parsed_args: &ParsedArguments) -> Result<pro
cwd.join(&parsed_args.input)
};
std::fs::read(input)
.map_err(|e| anyhow::Error::new(e))
.map_err(anyhow::Error::new)
.map(|s| process::Output {
status: process::ExitStatus::default(),
stdout: s.to_vec(),
Expand Down
4 changes: 2 additions & 2 deletions src/compiler/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -635,11 +635,11 @@ where

#[cfg(not(feature = "dist-client"))]
async fn dist_or_local_compile<T>(
service: server::SccacheService<T>,
service: &server::SccacheService<T>,
_dist_client: Option<Arc<dyn dist::Client>>,
creator: T,
_cwd: PathBuf,
compilation: Box<dyn Compilation>,
compilation: Box<dyn Compilation<T>>,
_weak_toolchain_key: String,
out_pretty: String,
) -> Result<(Cacheable, DistType, process::Output)>
Expand Down
14 changes: 7 additions & 7 deletions src/compiler/nvcc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use crate::compiler::{
CompileCommandImpl, CompilerArguments, Language,
};
use crate::mock_command::{
exit_status, CommandChild, CommandCreator, CommandCreatorSync, RunCommand,
exit_status, ExitStatusValue, CommandChild, CommandCreator, CommandCreatorSync, RunCommand,
};
use crate::util::{run_input_output, OsStrExt};
use crate::{counted_array, dist, protocol, server};
Expand Down Expand Up @@ -640,8 +640,8 @@ where
if val != " " {
pair.1 = val
.trim()
.split(" ")
.map(|x| x.trim_start_matches("\"").trim_end_matches("\""))
.split(' ')
.map(|x| x.trim_start_matches('\"').trim_end_matches('\"'))
.collect::<Vec<_>>()
.join(" ")
.into();
Expand Down Expand Up @@ -685,7 +685,7 @@ where
ext_counts: &mut HashMap<String, i32>,
) {
for arg in &mut args[..] {
let maybe_ext = (!arg.starts_with("-"))
let maybe_ext = (!arg.starts_with('-'))
.then(|| {
[
".ptx",
Expand Down Expand Up @@ -960,7 +960,7 @@ fn aggregate_output(acc: &mut process::Output, res: Result<process::Output>) {
acc.status = exit_status(std::cmp::max(
acc.status.code().unwrap_or(0),
out.status.code().unwrap_or(0),
));
) as ExitStatusValue);
acc.stdout.extend(out.stdout);
acc.stderr.extend(out.stderr);
}
Expand All @@ -969,7 +969,7 @@ fn error_to_output(err: Error) -> process::Output {
match err.downcast::<ProcessError>() {
Ok(ProcessError(out)) => out,
Err(err) => process::Output {
status: exit_status(1),
status: exit_status(1 as ExitStatusValue),
stdout: vec![],
stderr: err.to_string().into_bytes(),
},
Expand All @@ -978,7 +978,7 @@ fn error_to_output(err: Error) -> process::Output {

fn compile_result_to_output(res: protocol::CompileFinished) -> process::Output {
process::Output {
status: exit_status(res.retcode.or(res.signal).unwrap_or(0)),
status: exit_status(res.retcode.or(res.signal).unwrap_or(0) as ExitStatusValue),
stdout: res.stdout,
stderr: res.stderr,
}
Expand Down
3 changes: 3 additions & 0 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ impl DistClientContainer {
Self {}
}

#[cfg(feature = "dist-client")]
pub fn new_with_state(_: DistClientState) -> Self {
Self {}
}
Expand Down Expand Up @@ -216,6 +217,7 @@ impl DistClientContainer {
}
}

#[cfg(feature = "dist-client")]
pub fn new_with_state(state: DistClientState) -> Self {
Self {
state: futures::lock::Mutex::new(state),
Expand Down Expand Up @@ -895,6 +897,7 @@ where
}
}

#[cfg(feature = "dist-client")]
pub fn mock_with_dist_client(
dist_client: Arc<dyn dist::Client>,
storage: Arc<dyn Storage>,
Expand Down

0 comments on commit 2b06902

Please sign in to comment.