Skip to content

Introduce try_get list methods #285

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

Merged
merged 1 commit into from
Aug 29, 2022
Merged

Conversation

marmeladema
Copy link
Contributor

@dwrensha here is the version with try_get methods

Fixes #251

@@ -117,8 +125,17 @@ impl <'a> FromPointerBuilder<'a> for Builder<'a> {

impl <'a> Builder<'a> {
pub fn get(self, index: u32) -> Result<crate::text::Builder<'a>> {
assert!(index < self.len());
Copy link
Member

Choose a reason for hiding this comment

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

good catch!

@dwrensha dwrensha merged commit 595d1c5 into capnproto:master Aug 29, 2022
@dwrensha
Copy link
Member

Thanks!

@marmeladema marmeladema deleted the try-get branch August 30, 2022 21:32
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.

Non-panicking capnp::struct_list::Reader::get
2 participants