Skip to content

Commit

Permalink
rust - satiate clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremylt committed Nov 11, 2024
1 parent 44b080e commit 876339d
Show file tree
Hide file tree
Showing 60 changed files with 53 additions and 5,348 deletions.
17 changes: 10 additions & 7 deletions examples/rust/ex1-volume/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,20 @@ fn example_1(options: opt::Opt) -> libceed::Result<()> {
quiet,
gallery,
} = options;
assert!(dim >= 1 && dim <= 3);
assert!((1..=3).contains(&dim));
assert!(mesh_degree >= 1);
assert!(solution_degree >= 1);
assert!(num_qpts >= 1);
let ncomp_x = dim;
let problem_size: i64;
if problem_size_requested < 0 {
problem_size = if test { 8 * 16 } else { 256 * 1024 };
let problem_size: i64 = if problem_size_requested < 0 {
if test {
8 * 16
} else {
256 * 1024
}
} else {
problem_size = problem_size_requested;
}
problem_size_requested
};

// Summary output
if !quiet {
Expand Down Expand Up @@ -102,7 +105,7 @@ fn example_1(options: opt::Opt) -> libceed::Result<()> {
if dim > 2 {
print!(", nz = {}", num_xyz[2]);
}
print!("\n");
println!();
}

// Build ElemRestriction objects describing the mesh and solution discrete
Expand Down
15 changes: 7 additions & 8 deletions examples/rust/ex2-surface/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,20 @@ fn example_2(options: opt::Opt) -> libceed::Result<()> {
quiet,
gallery,
} = options;
assert!(dim >= 1 && dim <= 3);
assert!((0..=3).contains(&dim));
assert!(mesh_degree >= 1);
assert!(solution_degree >= 1);
assert!(num_qpts >= 1);
let ncomp_x = dim;
let problem_size: i64;
if problem_size_requested < 0 {
problem_size = if test {
let problem_size: i64 = if problem_size_requested < 0 {
if test {
16 * 16 * (dim * dim) as i64
} else {
256 * 1024
};
}
} else {
problem_size = problem_size_requested;
}
problem_size_requested
};

// Summary output
if !quiet {
Expand Down Expand Up @@ -107,7 +106,7 @@ fn example_2(options: opt::Opt) -> libceed::Result<()> {
if dim > 2 {
print!(", nz = {}", num_xyz[2]);
}
print!("\n");
println!();
}

// Build ElemRestriction objects describing the mesh and solution discrete
Expand Down
17 changes: 10 additions & 7 deletions examples/rust/ex3-vector-volume/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,20 @@ fn example_3(options: opt::Opt) -> libceed::Result<()> {
quiet,
gallery,
} = options;
assert!(dim >= 1 && dim <= 3);
assert!((0..=3).contains(&dim));
assert!(mesh_degree >= 1);
assert!(solution_degree >= 1);
assert!(num_qpts >= 1);
let ncomp_x = dim;
let problem_size: i64;
if problem_size_requested < 0 {
problem_size = if test { 8 * 16 } else { 256 * 1024 };
let problem_size: i64 = if problem_size_requested < 0 {
if test {
8 * 16
} else {
256 * 1024
}
} else {
problem_size = problem_size_requested;
}
problem_size_requested
};
let ncomp_u = 3;

// Summary output
Expand Down Expand Up @@ -104,7 +107,7 @@ fn example_3(options: opt::Opt) -> libceed::Result<()> {
if dim > 2 {
print!(", nz = {}", num_xyz[2]);
}
print!("\n");
println!();
}

// Build ElemRestriction objects describing the mesh and solution discrete
Expand Down
15 changes: 7 additions & 8 deletions examples/rust/ex4-vector-surface/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,20 @@ fn example_4(options: opt::Opt) -> libceed::Result<()> {
quiet,
gallery,
} = options;
assert!(dim >= 1 && dim <= 3);
assert!((0..=3).contains(&dim));
assert!(mesh_degree >= 1);
assert!(solution_degree >= 1);
assert!(num_qpts >= 1);
let ncomp_x = dim;
let problem_size: i64;
if problem_size_requested < 0 {
problem_size = if test {
let problem_size: i64 = if problem_size_requested < 0 {
if test {
16 * 16 * (dim * dim) as i64
} else {
256 * 1024
};
}
} else {
problem_size = problem_size_requested;
}
problem_size_requested
};
let ncomp_u = 3;

// Summary output
Expand Down Expand Up @@ -109,7 +108,7 @@ fn example_4(options: opt::Opt) -> libceed::Result<()> {
if dim > 2 {
print!(", nz = {}", num_xyz[2]);
}
print!("\n");
println!();
}

// Build ElemRestriction objects describing the mesh and solution discrete
Expand Down
88 changes: 0 additions & 88 deletions examples/zig/.zig-cache/h/15f2301655d3c70b6a666f9cdf310275.txt

This file was deleted.

Empty file.
85 changes: 0 additions & 85 deletions examples/zig/.zig-cache/h/27ec2f6229ef74ecea7fabcbe8cab205.txt

This file was deleted.

Empty file.
Loading

0 comments on commit 876339d

Please sign in to comment.