Skip to content

Commit 8f19d39

Browse files
Improve CI to run on Linux, MacOS and Windows (#30)
Run the CI with default crate configuration on: - Linux (Ubuntu) - MacOS - Windows
1 parent 9db19ca commit 8f19d39

File tree

2 files changed

+38
-4
lines changed

2 files changed

+38
-4
lines changed

.github/workflows/multi-os.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Multiple OS
2+
# Test the default configuration on multiple operating systems
3+
4+
on:
5+
push:
6+
branches: [ master ]
7+
pull_request:
8+
branches: [ master ]
9+
10+
jobs:
11+
build_matrix:
12+
name: Run tests for ${{ matrix.os }}
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
matrix:
16+
name: [linux, windows, macos]
17+
include:
18+
- name: linux
19+
os: ubuntu-latest
20+
- name: windows
21+
os: windows-latest
22+
- name: macos
23+
os: macos-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
with:
27+
submodules: recursive
28+
- uses: dtolnay/rust-toolchain@master
29+
with:
30+
toolchain: stable
31+
- name: Run Build
32+
run: cargo build
33+
- name: Run Tests
34+
run: cargo test --all

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,14 +330,14 @@ impl<'a> Graph<'a> {
330330
};
331331

332332
let mut prev = 0;
333-
for x in &*xadj {
333+
for x in xadj {
334334
if prev > *x {
335335
return Err(NewGraphError::msg("index list is not sorted"));
336336
}
337337
prev = *x;
338338
}
339339

340-
for a in &*adjncy {
340+
for a in adjncy {
341341
if *a < 0 || *a >= nvtxs {
342342
return Err(NewGraphError::msg(
343343
"some values in the adjacency list are out of bounds",
@@ -859,7 +859,7 @@ impl<'a> Mesh<'a> {
859859
if nparts <= 0 {
860860
return Err(NewMeshError::NoParts);
861861
}
862-
let (_ne, nn) = check_mesh_structure(&*eptr, &*eind)?;
862+
let (_ne, nn) = check_mesh_structure(eptr, eind)?;
863863
Ok(unsafe { Mesh::new_unchecked(nn, nparts, eptr, eind) })
864864
}
865865

@@ -1164,7 +1164,7 @@ impl Drop for Dual {
11641164
/// This function returns an error if `eptr` and `eind` don't follow the mesh
11651165
/// format given in [`Mesh::new`].
11661166
pub fn mesh_to_dual(eptr: &[Idx], eind: &[Idx], ncommon: Idx) -> Result<Dual> {
1167-
let (ne, nn) = check_mesh_structure(&*eptr, &*eind)?;
1167+
let (ne, nn) = check_mesh_structure(eptr, eind)?;
11681168
let mut xadj = mem::MaybeUninit::uninit();
11691169
let mut adjncy = mem::MaybeUninit::uninit();
11701170
let numbering_flag = 0;

0 commit comments

Comments
 (0)