Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add from_bytes method. #2329

Merged
merged 2 commits into from
Nov 25, 2024
Merged

Add from_bytes method. #2329

merged 2 commits into from
Nov 25, 2024

Conversation

tbro
Copy link
Contributor

@tbro tbro commented Nov 25, 2024

Closes #2327

Adds from_bytes method to NsTable to facilitate nitro development (see issue).

@tbro tbro requested review from ImJeremyHe and mrain and removed request for ImJeremyHe November 25, 2024 17:26
@@ -100,6 +100,13 @@ impl NsTable {
self.len().in_bounds(index)
}

/// Instantiate an `NsTable` from a byte slice.
pub fn from_bytes(bytes: &[u8]) -> NsTable {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: maybe call it from_bytes_unchecked.

@tbro tbro enabled auto-merge (squash) November 25, 2024 19:55
@tbro tbro merged commit c9f9583 into main Nov 25, 2024
19 checks passed
@tbro tbro deleted the tb/ns-table-from-bytes branch November 25, 2024 20:03
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.

Add NsTable::from_bytes
2 participants