Skip to content

Commit 4cb5a44

Browse files
authored
Merge pull request #239 from adamreichold/stricter-clippy
Make Clippy stricter
2 parents 347cc73 + baddc20 commit 4cb5a44

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ jobs:
1717
toolchain: stable
1818
profile: minimal
1919
components: rustfmt, clippy
20-
- run: |
20+
- env:
21+
CLIPPYFLAGS: --deny warnings --allow clippy::needless-lifetimes
22+
run: |
2123
cargo fmt --all -- --check
22-
cargo clippy --tests
23-
for example in examples/*; do (cd $example/; cargo clippy) || exit 1; done
24+
cargo clippy --tests -- $CLIPPYFLAGS
25+
for example in examples/*; do (cd $example/; cargo clippy -- $CLIPPYFLAGS) || exit 1; done
2426
2527
test:
2628
name: python${{ matrix.python-version }}-${{ matrix.platform.python-architecture }} ${{ matrix.platform.os }}

src/array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ impl<T: Element, D: Dimension> PyArray<T, D> {
453453
ID: IntoDimension<Dim = D>,
454454
{
455455
let dims = dims.into_dimension();
456-
let data_ptr = data_ptr.unwrap_or(boxed_slice.as_ptr());
456+
let data_ptr = data_ptr.unwrap_or_else(|| boxed_slice.as_ptr());
457457
let container = SliceBox::new(boxed_slice);
458458
let cell = pyo3::PyClassInitializer::from(container)
459459
.create_cell(py)

0 commit comments

Comments
 (0)