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

MSRV Testing in CI #11

Merged
merged 2 commits into from
Jan 3, 2024
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
5 changes: 4 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@ env:

jobs:
test:
strategy:
matrix:
rust-version: ["stable", "1.46.0"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: ${{ matrix.rust-version }}
profile: minimal
override: true
components: rustfmt
Expand Down
7 changes: 7 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#![forbid(unsafe_code)]
#![deny(missing_docs)]
#![cfg_attr(not(feature = "std"), no_std)]
// Allow identity ops for readability
#![allow(clippy::identity_op)]

use core::fmt;

Expand Down Expand Up @@ -94,6 +96,11 @@ impl ConstSlice {
self.head
}

/// Whether the buffer is empty or not.
pub const fn is_empty(&self) -> bool {
self.len() == 0
}

/// Get the buffer as a slice.
pub const fn as_slice(&self) -> &[u8] {
&self.data
Expand Down
Loading