Skip to content

Commit

Permalink
Merge pull request #11 from rylev/msrv-ci
Browse files Browse the repository at this point in the history
MSRV Testing in CI
  • Loading branch information
rylev authored Jan 3, 2024
2 parents 889f550 + 262d686 commit af789a3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
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

0 comments on commit af789a3

Please sign in to comment.