Repository navigation
refactor(fdt_mut)!: move slice access into FdtBuffer - #160
Merged
Merged
Conversation
m4tx
force-pushed
the
fdt-buffer-refactor
branch
from
November 27, 2026 13:03
80ddd01 to
7b5dbd7
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #160 +/- ##
==========================================
+ Coverage 95.15% 95.36% +0.20%
==========================================
Files 27 27
Lines 3985 3991 +6
==========================================
+ Hits 3792 3806 +14
+ Misses 193 185 -8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
m4tx
force-pushed
the
fdt-buffer-refactor
branch
from
November 27, 2026 13:34
7b5dbd7 to
b94f804
Compare
qwandor
approved these changes
Nov 27, 2026
FdtBuffer requiring AsRef/AsMut implementations might potentially give us wrong semantics, as these traits do not have any requirements beyond "it's cheap to perform the conversion". In case of slices, for instance, it's wrong because AsRef returns the entire slice, whereas FdtBuffer's contract is to only return the FDT blob part (so `totalsize` bytes), creating the need for the `SliceBuffer` wrapper. Moreover, AsMut doesn't require the implementations to return the same data as AsRef, even though we rely on that. This changes the trait definition to drop the AsRef/AsMut requirement and instead use explicit `data()`/`data_mut()` methods. This allows us to drop the `SliceBuffer` helper and `FdtMut::from_slice*` constructors.
m4tx
force-pushed
the
fdt-buffer-refactor
branch
from
November 27, 2026 18:23
b94f804 to
aa12a92
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
FdtBuffer requiring AsRef/AsMut implementations might potentially give us wrong semantics, as these traits do not have any requirements beyond "it's cheap to perform the conversion". In case of slices, for instance, it's wrong because AsRef returns the entire slice, whereas FdtBuffer's contract is to only return the FDT blob part (so
totalsizebytes), creating the need for theSliceBufferwrapper. Moreover, AsMut doesn't require the implementations to return the same data as AsRef, even though we rely on that.This changes the trait definition to drop the AsRef/AsMut requirement and instead use explicit
data()/data_mut()methods. This allows us to drop theSliceBufferhelper andFdtMut::from_slice*constructors.