3 ms·
> #[cfg(windows)] slice: &[u16] Am I the only one who finds this syntax ugly - to the point of being inappropriate for a general-purpose programming langu
by Koshkin 7y ago
>
#[cfg(windows)] slice: &[u16]
Am I the only one who finds this syntax ugly - to the point of being inappropriate for a general-purpose programming language?
- TazeTSchnitzel 7y agoCould you be constructive and say what, specifically, you dislike about it? Do you fully understand what each component means?
- orthecreedence 7y agoAs someone who uses rust a fair amount, I can say that the syntax looks pretty normal to me. It's saying "only define this field if we're compiling on windows." I parsed that out immediately. Maybe it just takes a bit of familiarity with the language, but everything does fit together really well after the initial learning phases.
- kpp 7y agoIt is quite useful sometimes: https://github.com/tox-rs/tox-node/blob/master/src/node_config.rs#L39..L60 https://github.com/tox-rs/tox-node/blob/master/src/node_conf...