Skip to content

Commit

Permalink
Correct style issues found by clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
robertmaynard authored and sylvestre committed Sep 28, 2023
1 parent 896cef1 commit 1ac4a0c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions src/compiler/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1233,14 +1233,14 @@ compiler_version=__VERSION__
}
"nvcc" | "nvcc-msvc" | "nvcc-nvhpc" => {
let host_compiler = match kind {
"nvcc-nvhpc" => NvccHostCompiler::NVHPC,
"nvcc-msvc" => NvccHostCompiler::MSVC,
"nvcc" => NvccHostCompiler::GCC,
&_ => NvccHostCompiler::GCC,
"nvcc-nvhpc" => NvccHostCompiler::Nvhpc,
"nvcc-msvc" => NvccHostCompiler::Msvc,
"nvcc" => NvccHostCompiler::Gcc,
&_ => NvccHostCompiler::Gcc,
};
return CCompiler::new(
Nvcc {
host_compiler: host_compiler,
host_compiler,
version: version.clone(),
},
executable,
Expand Down
16 changes: 8 additions & 8 deletions src/compiler/nvcc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ use crate::errors::*;
/// A unit struct on which to implement `CCompilerImpl`.
#[derive(Clone, Debug)]
pub enum NvccHostCompiler {
GCC,
MSVC,
NVHPC,
Gcc,
Msvc,
Nvhpc,
}

#[derive(Clone, Debug)]
Expand Down Expand Up @@ -161,9 +161,9 @@ impl CCompilerImpl for Nvcc {
// msvc requires the `-EP` flag to output no line numbers to console
// other host compilers are presumed to match `gcc` behavior
let no_line_num_flag = match self.host_compiler {
NvccHostCompiler::NVHPC => "",
NvccHostCompiler::MSVC => "-Xcompiler=-EP",
NvccHostCompiler::GCC => "-Xcompiler=-P",
NvccHostCompiler::Nvhpc => "",
NvccHostCompiler::Msvc => "-Xcompiler=-EP",
NvccHostCompiler::Gcc => "-Xcompiler=-P",
};
cmd.arg("-E")
.arg(no_line_num_flag)
Expand Down Expand Up @@ -277,15 +277,15 @@ mod test {
fn parse_arguments_gcc(arguments: Vec<String>) -> CompilerArguments<ParsedArguments> {
let arguments = arguments.iter().map(OsString::from).collect::<Vec<_>>();
Nvcc {
host_compiler: NvccHostCompiler::GCC,
host_compiler: NvccHostCompiler::Gcc,
version: None,
}
.parse_arguments(&arguments, ".".as_ref())
}
fn parse_arguments_nvc(arguments: Vec<String>) -> CompilerArguments<ParsedArguments> {
let arguments = arguments.iter().map(OsString::from).collect::<Vec<_>>();
Nvcc {
host_compiler: NvccHostCompiler::NVHPC,
host_compiler: NvccHostCompiler::Nvhpc,
version: None,
}
.parse_arguments(&arguments, ".".as_ref())
Expand Down

0 comments on commit 1ac4a0c

Please sign in to comment.