Closed clearloop closed 4 years ago
Rust doesn't support optional arguments like javascript, the syntax of style is too verbose, for example:
impl Default for TextStyle { fn default() -> TextStyle { TextStyle { bold: true, color: Colors::Pink, italic: true, size: Unit::Rem(2.0), weight: Unit::None(400.0), height: Unit::Rem(1.0), stretch: Unit::Percent(100.0), } } }
We need a syntax of chain setting styles like:
let style = TextStyle::new().bold(true);
Desc
Rust doesn't support optional arguments like javascript, the syntax of style is too verbose, for example:
We need a syntax of chain setting styles like: