why put setters in blocks? #556
Answered
by
dwrensha
andrewbanchich
asked this question in
Q&A
-
hi! i noticed the examples show setters being scoped to blocks, like this: https://github.com/capnproto/capnproto-rust/blob/master/example/addressbook/addressbook.rs#L37-L51 what's the reason for this approach? |
Beta Was this translation helpful? Give feedback.
Answered by
dwrensha
Apr 27, 2025
Replies: 2 comments 2 replies
-
I believe that kind of structuring was necessary before non-lexical lifetimes landed in Rust. https://blog.rust-lang.org/2022/08/05/nll-by-default/ |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
andrewbanchich
-
I updated the addressbook example: a095255 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I believe that kind of structuring was necessary before non-lexical lifetimes landed in Rust. https://blog.rust-lang.org/2022/08/05/nll-by-default/