mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-30 12:07:40 +00:00
![]() 11145: feat: add config to use reasonable default expression instead of todo! when filling missing fields r=Veykril a=bnjjj Use `Default::default()` in struct fields when we ask to fill it instead of putting `todo!()` for every fields before: ```rust pub enum Other { One, Two, } pub struct Test { text: String, num: usize, other: Other, } fn t_test() { let test = Test {<|>}; } ``` after: ```rust pub enum Other { One, Two, } pub struct Test { text: String, num: usize, other: Other, } fn t_test() { let test = Test { text: String::new(), num: 0, other: todo!(), }; } ``` Co-authored-by: Benjamin Coenen <5719034+bnjjj@users.noreply.github.com> Co-authored-by: Coenen Benjamin <benjamin.coenen@hotmail.com> |
||
---|---|---|
.. | ||
ast | ||
parsing | ||
tests | ||
validation | ||
algo.rs | ||
ast.rs | ||
display.rs | ||
fuzz.rs | ||
hacks.rs | ||
lib.rs | ||
parsing.rs | ||
ptr.rs | ||
syntax_error.rs | ||
syntax_node.rs | ||
ted.rs | ||
tests.rs | ||
token_text.rs | ||
utils.rs | ||
validation.rs |