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
2 changes: 1 addition & 1 deletion .github/workflows/rust-test-with-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
env:
CC: ${{ matrix.compiler }}
FC: gfortran
run: cargo llvm-cov test --doctests --lcov --output-path lcov.info
run: CARGO_CEED_OPT_FLAGS="-g -O0 -fno-inline" cargo llvm-cov test --doctests --lcov --output-path lcov.info
Comment thread
jeremylt marked this conversation as resolved.
- name: Codecov upload
uses: codecov/codecov-action@v4
with:
Expand Down
4 changes: 2 additions & 2 deletions examples/rust/mesh/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub fn build_cartesian_restriction(
degree: usize,
num_comp: usize,
num_qpts: usize,
) -> libceed::Result<(ElemRestriction, ElemRestriction)> {
) -> libceed::Result<(ElemRestriction<'_>, ElemRestriction<'_>)> {
let p = degree + 1;
let num_nodes = p.pow(dim as u32); // number of nodes per element
let elem_qpts = num_qpts.pow(dim as u32); // number of quadrature pts per element
Expand Down Expand Up @@ -119,7 +119,7 @@ pub fn cartesian_mesh_coords(
num_xyz: [usize; 3],
mesh_degree: usize,
mesh_size: usize,
) -> libceed::Result<Vector> {
) -> libceed::Result<Vector<'_>> {
let p = mesh_degree + 1;
let mut num_d = [0; 3];
let mut scalar_size = 1;
Expand Down
4 changes: 4 additions & 0 deletions rust/libceed-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ fn main() {
} else {
// Install libceed.a or libceed.so to $OUT_DIR/lib
let makeflags = env("CARGO_MAKEFLAGS").unwrap();
let optflags = env("CARGO_CEED_OPT_FLAGS").unwrap_or_else(|| "".to_string());
let mut make = Command::new("make");
make.arg("install")
.arg(format!("prefix={}", out_dir.to_string_lossy()))
Expand All @@ -28,6 +29,9 @@ fn main() {
.arg("FC=") // Don't try to find Fortran (unused library build/install)
.env("MAKEFLAGS", makeflags)
.current_dir("c-src");
if optflags.len() > 0 {
make.env("OPT", optflags);
}
if statik {
make.arg("STATIC=1");
}
Expand Down
10 changes: 5 additions & 5 deletions rust/libceed/src/operator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ impl<'a> OperatorField<'a> {
/// # Ok(())
/// # }
/// ```
pub fn elem_restriction(&self) -> ElemRestrictionOpt {
pub fn elem_restriction(&self) -> ElemRestrictionOpt<'_> {
if self.elem_restriction.ptr == unsafe { bind_ceed::CEED_ELEMRESTRICTION_NONE } {
ElemRestrictionOpt::None
} else {
Expand Down Expand Up @@ -237,7 +237,7 @@ impl<'a> OperatorField<'a> {
/// # Ok(())
/// # }
/// ```
pub fn basis(&self) -> BasisOpt {
pub fn basis(&self) -> BasisOpt<'_> {
if self.basis.ptr == unsafe { bind_ceed::CEED_BASIS_NONE } {
BasisOpt::None
} else {
Expand Down Expand Up @@ -285,7 +285,7 @@ impl<'a> OperatorField<'a> {
/// # Ok(())
/// # }
/// ```
pub fn vector(&self) -> VectorOpt {
pub fn vector(&self) -> VectorOpt<'_> {
if self.vector.ptr == unsafe { bind_ceed::CEED_VECTOR_ACTIVE } {
VectorOpt::Active
} else if self.vector.ptr == unsafe { bind_ceed::CEED_VECTOR_NONE } {
Expand Down Expand Up @@ -856,7 +856,7 @@ impl<'a> Operator<'a> {
/// # Ok(())
/// # }
/// ```
pub fn inputs(&self) -> crate::Result<Vec<crate::OperatorField>> {
pub fn inputs(&self) -> crate::Result<Vec<crate::OperatorField<'_>>> {
// Get array of raw C pointers for inputs
let mut num_inputs = 0;
let mut inputs_ptr = std::ptr::null_mut();
Expand Down Expand Up @@ -926,7 +926,7 @@ impl<'a> Operator<'a> {
/// # Ok(())
/// # }
/// ```
pub fn outputs(&self) -> crate::Result<Vec<crate::OperatorField>> {
pub fn outputs(&self) -> crate::Result<Vec<crate::OperatorField<'_>>> {
// Get array of raw C pointers for outputs
let mut num_outputs = 0;
let mut outputs_ptr = std::ptr::null_mut();
Expand Down
12 changes: 6 additions & 6 deletions rust/libceed/src/qfunction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ impl<'a> QFunctionCore<'a> {
})
}

pub fn inputs(&self) -> crate::Result<&[QFunctionField]> {
pub fn inputs(&self) -> crate::Result<&[QFunctionField<'_>]> {
// Get array of raw C pointers for inputs
let mut num_inputs = 0;
let mut inputs_ptr = std::ptr::null_mut();
Expand All @@ -487,7 +487,7 @@ impl<'a> QFunctionCore<'a> {
Ok(inputs_slice)
}

pub fn outputs(&self) -> crate::Result<&[QFunctionField]> {
pub fn outputs(&self) -> crate::Result<&[QFunctionField<'_>]> {
// Get array of raw C pointers for outputs
let mut num_outputs = 0;
let mut outputs_ptr = std::ptr::null_mut();
Expand Down Expand Up @@ -826,7 +826,7 @@ impl<'a> QFunction<'a> {
/// # Ok(())
/// # }
/// ```
pub fn inputs(&self) -> crate::Result<&[QFunctionField]> {
pub fn inputs(&self) -> crate::Result<&[QFunctionField<'_>]> {
self.qf_core.inputs()
}

Expand Down Expand Up @@ -856,7 +856,7 @@ impl<'a> QFunction<'a> {
/// # Ok(())
/// # }
/// ```
pub fn outputs(&self) -> crate::Result<&[QFunctionField]> {
pub fn outputs(&self) -> crate::Result<&[QFunctionField<'_>]> {
self.qf_core.outputs()
}
}
Expand Down Expand Up @@ -960,7 +960,7 @@ impl<'a> QFunctionByName<'a> {
/// # Ok(())
/// # }
/// ```
pub fn inputs(&self) -> crate::Result<&[QFunctionField]> {
pub fn inputs(&self) -> crate::Result<&[QFunctionField<'_>]> {
self.qf_core.inputs()
}

Expand All @@ -979,7 +979,7 @@ impl<'a> QFunctionByName<'a> {
/// # Ok(())
/// # }
/// ```
pub fn outputs(&self) -> crate::Result<&[QFunctionField]> {
pub fn outputs(&self) -> crate::Result<&[QFunctionField<'_>]> {
self.qf_core.outputs()
}
}
Expand Down
4 changes: 2 additions & 2 deletions rust/libceed/src/vector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ impl<'a> Vector<'a> {
/// # Ok(())
/// # }
/// ```
pub fn view(&self) -> crate::Result<VectorView> {
pub fn view(&self) -> crate::Result<VectorView<'_>> {
VectorView::new(self)
}

Expand All @@ -583,7 +583,7 @@ impl<'a> Vector<'a> {
/// # Ok(())
/// # }
/// ```
pub fn view_mut(&mut self) -> crate::Result<VectorViewMut> {
pub fn view_mut(&mut self) -> crate::Result<VectorViewMut<'_>> {
VectorViewMut::new(self)
}

Expand Down
2 changes: 2 additions & 0 deletions tests/t599-operator.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ int main(int argc, char **argv) {
CeedVectorRestoreArrayRead(v, &v_array);
// Summing 9 reference elements, each 2x2 => 36 sq units area
if (fabs(sum - 4.0 * num_elem) > CEED_EPSILON * 5e3) {
// LCOV_EXCL_START
printf("Incorrect area computed, %g != %g (abs error %g)\n", sum, 4.0 * num_elem, fabs(sum - 4.0 * num_elem));
// LCOV_EXCL_STOP
}
}

Expand Down
Loading