Stream: wit-bindgen

Topic: change default `list<primitive>` arg type to `&[T]`


view this post on Zulip Lann Martin (Nov 27 2023 at 19:30):

https://github.com/bytecodealliance/wit-bindgen/issues/769

The default ownership: Owning setting is sufficient for most use cases and generally simpler than Borrowing, but necessitates copies in some situations where they aren't strictly necessary. One not...

view this post on Zulip Lann Martin (Nov 27 2023 at 19:31):

tldr: fn write(&self, contents: &[u8]) ... by default instead of Vec<u8>

view this post on Zulip Alex Crichton (Nov 27 2023 at 19:33):

I think that makes sense yeah, and while the logic for figuring out what ownership is pretty hairy already this is pretty targeted and I think will fit well

view this post on Zulip Lann Martin (Nov 27 2023 at 22:05):

Should string params get the same treatment (String -> &str)?


Last updated: Nov 22 2024 at 16:03 UTC