Skip to content

Commit

Permalink
update ci (clippy)
Browse files Browse the repository at this point in the history
  • Loading branch information
AdinAck committed Nov 1, 2024
1 parent 4202ea4 commit 3b83002
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
6 changes: 3 additions & 3 deletions ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ rustup toolchain install nightly --component miri
TARGETS=("thumbv6m-none-eabi" "thumbv7em-none-eabi" "thumbv7em-none-eabihf")
CRATES=("macros" "cookie-cutter" "dispatch-bundle")

# clippy
cargo clippy

# build

for TARGET in "${TARGETS[@]}"; do
Expand All @@ -29,6 +26,9 @@ done

cargo +nightly miri test -p embedded-command command_buffer

# clippy
cargo clippy

# crate-specific

# cookie-cutter
Expand Down
4 changes: 2 additions & 2 deletions cookie-cutter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ pub unsafe trait SerializeBuf<E: Encoding = Vanilla>: SerializeIter<E> {
fn serialize_buf(&self, dest: &mut Self::Serialized) {
// SAFETY: dependent on safety of trait implementation.
// `Serialized` must be of sufficient length.
unsafe { SerializeIter::serialize_iter(self, &mut dest.get_iter_mut()).unwrap_unchecked() };
unsafe { SerializeIter::serialize_iter(self, dest.get_iter_mut()).unwrap_unchecked() };
}

/// Deserialize the implementer type from a
/// serialization medium.
fn deserialize_buf(src: &Self::Serialized) -> Result<Self, error::Invalid> {
SerializeIter::deserialize_iter(&mut src.get_iter()).or_else(|err| match err {
SerializeIter::deserialize_iter(src.get_iter()).or_else(|err| match err {
error::Error::Invalid => Err(error::Invalid),
// SAFETY: dependent on safety of trait implementation.
// `Serialized` must be of sufficient length.
Expand Down
8 changes: 7 additions & 1 deletion embedded-command/src/command_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ pub struct CommandBuffer<const N: usize> {
size: usize,
}

impl<const N: usize> Default for CommandBuffer<N> {
fn default() -> Self {
Self::new()
}
}

impl<const N: usize> CommandBuffer<N> {
pub const fn new() -> Self {
Self {
Expand Down Expand Up @@ -88,7 +94,7 @@ impl<const N: usize> CommandBuffer<N> {

/// Create an iterator for the command buffer.
#[inline]
pub fn iter<'a>(&'a mut self) -> CommandBufferIter<'a, N> {
pub fn iter(&mut self) -> CommandBufferIter<'_, N> {
CommandBufferIter::new(self)
}

Expand Down

0 comments on commit 3b83002

Please sign in to comment.