Re: [dev-servo] RFC: parameter structs for new()

2017-12-26 Thread Enrico Weigelt, metux IT consult via dev-servo
On 25.12.2017 17:01, Steve Klabnik wrote: You'd use them on the function signature itself, rather than the parameter. Yeah, eg. Window::new() now takes an WindowParam struct instead of IpcSender. The caller now has to prepare a proper WindowParam that contains the bluetooth_thread if the webapi

Re: [dev-servo] RFC: parameter structs for new()

2017-12-25 Thread Steve Klabnik
You'd use them on the function signature itself, rather than the parameter. On Sat, Dec 23, 2017 at 1:47 PM, Enrico Weigelt, metux IT consult via dev-servo wrote: > Hi folks, > > while trying to make some features optional (eg. bluetooth, vr, ...) > I've seen several of the types I'd like to get

[dev-servo] RFC: parameter structs for new()

2017-12-23 Thread Enrico Weigelt, metux IT consult via dev-servo
Hi folks, while trying to make some features optional (eg. bluetooth, vr, ...) I've seen several of the types I'd like to get rid of in new() calls. Rust doesn't seem to support #[cfg()] on function parameters. OTOH, this works on struct fields. Just using Option<> here doesn't help as I'd like