Skip to content

Keep alignment when slicing arrays - #31

Open
Shatur wants to merge 1 commit into
rust-embedded-community:masterfrom
fortify-iq:align-slicing
Open

Shatur wants to merge 1 commit into
rust-embedded-community:masterfrom
fortify-iq:align-slicing

Conversation

@Shatur

@Shatur Shatur commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Add Index and IndexMut implementations for Aligned<A, [T; N]>. This allows array slicing to return aligned slices directly:

let mut buffer: Aligned<A4, _> = Aligned([0u8; 16]);
let slice: &Aligned<A4, [u8]> = &buffer[..7];

Add `Index` and `IndexMut` implementations for `Aligned<A, [T; N]>`.
This allows array slicing to return aligned slices directly:
```rust
let mut buffer: Aligned<A4, _> = Aligned([0u8; 16]);
let slice: &Aligned<A4, [u8]> = &buffer[..7];
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant