Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve CI #344

Merged
merged 3 commits into from
Sep 29, 2023
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
65 changes: 16 additions & 49 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,88 +17,55 @@ jobs:
- --no-default-features

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4

- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true

- uses: actions-rs/cargo@v1
with:
command: build
args: -p hecs --all-targets ${{ matrix.features }}
- run: cargo build -p hecs --all-targets ${{ matrix.features }}

- uses: actions-rs/cargo@v1
with:
command: test
args: -p hecs ${{ matrix.features }}
- run: cargo test -p hecs ${{ matrix.features }}

no-std-build-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4

- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
target: x86_64-unknown-none
override: true
targets: x86_64-unknown-none

# Build the `test-no-std-macros` target with x86_64-unknown-none target
- uses: actions-rs/cargo@v1
with:
command: build
args: -p test-no-std-macros --target x86_64-unknown-none
- run: cargo build -p test-no-std-macros --target x86_64-unknown-none

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4

- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt, clippy

- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- run: cargo fmt --all -- --check

- name: doc
run: cargo doc --no-deps --all-features
env:
RUSTDOCFLAGS: -Dwarnings

- uses: actions-rs/cargo@v1
if: always()
with:
command: clippy
args: --all-features -- -D warnings
- run: cargo clippy --all-features -- -D warnings

miri:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4

- uses: actions-rs/toolchain@v1
- uses: dtolnay/rust-toolchain@nightly
with:
profile: minimal
toolchain: nightly
override: true
components: miri, rust-src

- uses: actions-rs/cargo@v1
with:
command: miri
args: setup
- run: cargo miri setup

- uses: actions-rs/cargo@v1
with:
command: miri
args: test --all-features
- run: cargo miri test --all-features
4 changes: 2 additions & 2 deletions src/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1238,12 +1238,12 @@ impl<'q, Q: Query> PreparedQueryBorrow<'q, Q> {

/// Execute the prepared query
// The lifetime narrowing here is required for soundness.
pub fn iter<'i>(&'i mut self) -> PreparedQueryIter<'i, Q> {
pub fn iter(&mut self) -> PreparedQueryIter<'_, Q> {
unsafe { PreparedQueryIter::new(self.meta, self.archetypes, self.state.iter()) }
}

/// Provides random access to the results of the prepared query
pub fn view<'i>(&'i mut self) -> PreparedView<'i, Q> {
pub fn view(&mut self) -> PreparedView<'_, Q> {
unsafe { PreparedView::new(self.meta, self.archetypes, self.state.iter(), self.fetch) }
}
}
Expand Down