Closed
Description
Do you want to accept the "Self(0, 0)" syntax too? I think it's more DRY:
struct VecA { x: u32, y: u32 }
impl VecA {
fn new() -> Self {
Self { x: 0, y: 0 } // OK
}
}
struct VecB(u32, u32);
impl VecB {
fn new() -> Self {
Self(0, 0) // Error
}
}
fn main() {}
The current error message is:
error[E0423]: expected function, found self type `Self`
--> ...\test.rs:10:9
|
10 | Self(0, 0) // Error
| ^^^^ did you mean `Self { /* fields */ }`?