Why should i assign return type twice
⚓ Rust 📅 2025-12-31 👤 surdeus 👁️ 4I can specify the type of returning value in the add function itself but why is it asking me to assign the type again?
impl ops::Add<Complex> for Complex {
type Output = Complex;
fn add(self, _rhs: Complex) -> Complex {
Complex::default()
}
}
8 posts - 4 participants
🏷️ Rust_feed
