Skip to content
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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ solana = "2.3.4"
# Specify Rust toolchains for rustfmt, clippy, and build.
# Any unprovided toolchains default to stable.
[workspace.metadata.toolchains]
nightly = "nightly-2025-02-16"
nightly = "nightly-2026-01-22"

[workspace.metadata.spellcheck]
config = "scripts/spellcheck.toml"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
RUST_TOOLCHAIN_NIGHTLY = nightly-2025-02-16
RUST_TOOLCHAIN_NIGHTLY = nightly-2026-01-22
SOLANA_CLI_VERSION = 2.3.4

nightly = +${RUST_TOOLCHAIN_NIGHTLY}
Expand Down
8 changes: 4 additions & 4 deletions list-view/src/list_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ impl<T: Pod, L: PodLength> ListView<T, L> {
}

/// Unpack a read-only buffer into a `ListViewReadOnly`
pub fn unpack(buf: &[u8]) -> Result<ListViewReadOnly<T, L>, ProgramError> {
pub fn unpack(buf: &[u8]) -> Result<ListViewReadOnly<'_, T, L>, ProgramError> {
let layout = Self::calculate_layout(buf.len())?;

// Slice the buffer to get the length prefix and the data.
Expand Down Expand Up @@ -87,7 +87,7 @@ impl<T: Pod, L: PodLength> ListView<T, L> {
}

/// Unpack the mutable buffer into a mutable `ListViewMut`
pub fn unpack_mut(buf: &mut [u8]) -> Result<ListViewMut<T, L>, ProgramError> {
pub fn unpack_mut(buf: &mut [u8]) -> Result<ListViewMut<'_, T, L>, ProgramError> {
let view = Self::build_mut_view(buf)?;
if (*view.length).into() > view.capacity {
return Err(ListViewError::BufferTooSmall.into());
Expand All @@ -96,15 +96,15 @@ impl<T: Pod, L: PodLength> ListView<T, L> {
}

/// Initialize a buffer: sets `length = 0` and returns a mutable `ListViewMut`.
pub fn init(buf: &mut [u8]) -> Result<ListViewMut<T, L>, ProgramError> {
pub fn init(buf: &mut [u8]) -> Result<ListViewMut<'_, T, L>, ProgramError> {
let view = Self::build_mut_view(buf)?;
*view.length = L::try_from(0usize).map_err(ListViewError::from)?;
Ok(view)
}

/// Internal helper to build a mutable view without validation or initialization.
#[inline]
fn build_mut_view(buf: &mut [u8]) -> Result<ListViewMut<T, L>, ProgramError> {
fn build_mut_view(buf: &mut [u8]) -> Result<ListViewMut<'_, T, L>, ProgramError> {
let layout = Self::calculate_layout(buf.len())?;

// Split the buffer to get the length prefix and the data.
Expand Down
2 changes: 1 addition & 1 deletion list-view/src/list_view_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ mod tests {
fn init_view_mut<T: Pod, L: PodLength>(
buffer: &mut Vec<u8>,
capacity: usize,
) -> ListViewMut<T, L> {
) -> ListViewMut<'_, T, L> {
let size = ListView::<T, L>::size_of(capacity).unwrap();
buffer.resize(size, 0);
ListView::<T, L>::init(buffer).unwrap()
Expand Down
8 changes: 4 additions & 4 deletions pod/src/list/list_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl<T: Pod, L: PodLength> ListView<T, L> {
}

/// Unpack a read-only buffer into a `ListViewReadOnly`
pub fn unpack(buf: &[u8]) -> Result<ListViewReadOnly<T, L>, ProgramError> {
pub fn unpack(buf: &[u8]) -> Result<ListViewReadOnly<'_, T, L>, ProgramError> {
let layout = Self::calculate_layout(buf.len())?;

// Slice the buffer to get the length prefix and the data.
Expand Down Expand Up @@ -90,7 +90,7 @@ impl<T: Pod, L: PodLength> ListView<T, L> {
}

/// Unpack the mutable buffer into a mutable `ListViewMut`
pub fn unpack_mut(buf: &mut [u8]) -> Result<ListViewMut<T, L>, ProgramError> {
pub fn unpack_mut(buf: &mut [u8]) -> Result<ListViewMut<'_, T, L>, ProgramError> {
let view = Self::build_mut_view(buf)?;
if (*view.length).into() > view.capacity {
return Err(PodSliceError::BufferTooSmall.into());
Expand All @@ -100,7 +100,7 @@ impl<T: Pod, L: PodLength> ListView<T, L> {

/// Internal helper to build a mutable view without validation or initialization.
#[inline]
fn build_mut_view(buf: &mut [u8]) -> Result<ListViewMut<T, L>, ProgramError> {
fn build_mut_view(buf: &mut [u8]) -> Result<ListViewMut<'_, T, L>, ProgramError> {
let layout = Self::calculate_layout(buf.len())?;

// Split the buffer to get the length prefix and the data.
Expand Down Expand Up @@ -180,7 +180,7 @@ where
PodSliceError: From<<L as TryFrom<usize>>::Error>,
{
/// Initialize a buffer: sets `length = 0` and returns a mutable `ListViewMut`.
pub fn init(buf: &mut [u8]) -> Result<ListViewMut<T, L>, ProgramError> {
pub fn init(buf: &mut [u8]) -> Result<ListViewMut<'_, T, L>, ProgramError> {
let view = Self::build_mut_view(buf)?;
*view.length = L::try_from(0).map_err(PodSliceError::from)?;
Ok(view)
Expand Down
2 changes: 1 addition & 1 deletion pod/src/list/list_view_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ mod tests {
fn init_view_mut<T: Pod, L: PodLength>(
buffer: &mut Vec<u8>,
capacity: usize,
) -> ListViewMut<T, L>
) -> ListViewMut<'_, T, L>
where
PodSliceError: From<<L as TryFrom<usize>>::Error>,
{
Expand Down
Loading