bytecodealliance / rustix

Safe Rust bindings to POSIX-ish APIs
Other
1.4k stars 139 forks source link

tcsetwinsize should use &Winsize #1083

Closed tianyuanhao closed 2 weeks ago

tianyuanhao commented 2 weeks ago

🤔 I find that only references to Winsize are used in the implementation.

Refs: #671, #673

✨ I've understood. It's because Winsize is too small, so it's OK to pass the value directly, right?

sunfishcode commented 2 weeks ago

I believe either way works and that it's just a question of API convenience and perhaps low-level optimization. I think the original idea was that passing it by value would be more convenient, but I'd be interested in hearing how it works out in practice.