The Swift language supports multiple if statements on one line.
import Foundation
let x: Int? = 7
if let y = x, pow(Double(y), 2) == 49 {
// do something
}
In rust I need to do
let x: Option<i32> = Some(7);
if let Some(y) = x {
if y.pow(2) == 49 {
// do something
}
}
Is there a way to do something like the Swift solution in rust?