Clippy lint fixes
This commit is contained in:
@@ -117,10 +117,10 @@ pub enum InterpolationOperator {
|
||||
NineH2,
|
||||
}
|
||||
|
||||
impl Into<Box<dyn sbp::operators::InterpolationOperator>> for InterpolationOperator {
|
||||
fn into(self) -> Box<dyn sbp::operators::InterpolationOperator> {
|
||||
impl From<InterpolationOperator> for Box<dyn sbp::operators::InterpolationOperator> {
|
||||
fn from(val: InterpolationOperator) -> Self {
|
||||
use sbp::operators::{Interpolation4, Interpolation8, Interpolation9, Interpolation9h2};
|
||||
match self {
|
||||
match val {
|
||||
InterpolationOperator::Four => Box::new(Interpolation4),
|
||||
InterpolationOperator::Eight => Box::new(Interpolation8),
|
||||
InterpolationOperator::Nine => Box::new(Interpolation9),
|
||||
|
||||
@@ -56,13 +56,13 @@ fn main() {
|
||||
let config: input::Configuration = match json5::from_str(&filecontents) {
|
||||
Ok(config) => config,
|
||||
Err(e) => {
|
||||
eprintln!("Configuration could not be read: {}", e);
|
||||
eprintln!("Configuration could not be read: {e}");
|
||||
if let json5::Error::Message {
|
||||
location: Some(location),
|
||||
..
|
||||
} = e
|
||||
{
|
||||
eprintln!("\t{:?}", location);
|
||||
eprintln!("\t{location:?}");
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -157,7 +157,7 @@ fn main() {
|
||||
println!("Time elapsed: {} seconds", duration.as_secs_f64());
|
||||
}
|
||||
if let Some(error) = outinfo.error {
|
||||
println!("Total error: {:e}", error);
|
||||
println!("Total error: {error:e}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,12 +139,12 @@ impl input::Configuration {
|
||||
let xi = operators.xi.unwrap_or_else(|| {
|
||||
default_operators
|
||||
.xi
|
||||
.unwrap_or_else(|| panic!("No xi operator found for grid: {}", name))
|
||||
.unwrap_or_else(|| panic!("No xi operator found for grid: {name}"))
|
||||
});
|
||||
let eta = operators.eta.unwrap_or_else(|| {
|
||||
default_operators
|
||||
.eta
|
||||
.unwrap_or_else(|| panic!("No eta operator found for grid: {}", name))
|
||||
.unwrap_or_else(|| panic!("No eta operator found for grid: {name}"))
|
||||
});
|
||||
|
||||
use input::Operator as op;
|
||||
@@ -183,9 +183,8 @@ impl input::Configuration {
|
||||
BoundaryConditions::Expressions(expr) => {
|
||||
euler::BoundaryCharacteristic::Eval(expr.clone() )
|
||||
}
|
||||
_ => panic!(
|
||||
"Boundary conditions are not available, but needed for grid {}",
|
||||
name
|
||||
BoundaryConditions::NotNeeded => panic!(
|
||||
"Boundary conditions are not available, but needed for grid {name}"
|
||||
),
|
||||
},
|
||||
Some(BoundaryType::This) => euler::BoundaryCharacteristic::This,
|
||||
@@ -193,7 +192,7 @@ impl input::Configuration {
|
||||
if let BoundaryConditions::Vortex(vortex) = &boundary_conditions {
|
||||
vortex.clone()
|
||||
} else {
|
||||
panic!("Wanted vortex boundary conditions not found, needed for grid {}", name)
|
||||
panic!("Wanted vortex boundary conditions not found, needed for grid {name}")
|
||||
},
|
||||
),
|
||||
Some(BoundaryType::Neighbour(name)) => {
|
||||
|
||||
@@ -200,7 +200,7 @@ impl BaseSystem {
|
||||
.zip(push)
|
||||
.enumerate()
|
||||
{
|
||||
let builder = std::thread::Builder::new().name(format!("mg: {}", name));
|
||||
let builder = std::thread::Builder::new().name(format!("mg: {name}"));
|
||||
|
||||
let boundary_conditions = bt.map(|bt| match bt {
|
||||
euler::BoundaryCharacteristic::This => DistributedBoundaryConditions::This,
|
||||
@@ -444,7 +444,7 @@ impl System {
|
||||
for _ in 0..sys.sys.len() {
|
||||
e += match sys.recv.recv().unwrap() {
|
||||
(_, MsgToHost::Error(e)) => e,
|
||||
(_, m) => panic!("Unexpected message: {:?}", m),
|
||||
(_, m) => panic!("Unexpected message: {m:?}"),
|
||||
}
|
||||
}
|
||||
e
|
||||
|
||||
Reference in New Issue
Block a user