mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-01 03:03:40 +00:00
ef59b34cd7
Extends the multi line condition to over other control flow expressions, it now covers: `if`, `if let`, `for`, `loop`, `while`, `while let` and `match`. Refs: #3029 Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
95 lines
2.0 KiB
Rust
95 lines
2.0 KiB
Rust
fn keep_if() {
|
|
{
|
|
{
|
|
{
|
|
EvaluateJSReply::NumberValue(
|
|
if FromJSValConvertible::from_jsval(cx, rval.handle(), ()) {
|
|
unimplemented!();
|
|
},
|
|
)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
fn keep_if_let() {
|
|
{
|
|
{
|
|
{
|
|
EvaluateJSReply::NumberValue(
|
|
if let Some(e) = FromJSValConvertible::from_jsval(cx, rval.handle(), ()) {
|
|
unimplemented!();
|
|
},
|
|
)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
fn keep_for() {
|
|
{
|
|
{
|
|
{
|
|
EvaluateJSReply::NumberValue(
|
|
for conv in FromJSValConvertible::from_jsval(cx, rval.handle(), ()) {
|
|
unimplemented!();
|
|
},
|
|
)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
fn keep_loop() {
|
|
{
|
|
{
|
|
{
|
|
EvaluateJSReply::NumberValue(loop {
|
|
FromJSValConvertible::from_jsval(cx, rval.handle(), ());
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
fn keep_while() {
|
|
{
|
|
{
|
|
{
|
|
EvaluateJSReply::NumberValue(
|
|
while FromJSValConvertible::from_jsval(cx, rval.handle(), ()) {
|
|
unimplemented!();
|
|
},
|
|
)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
fn keep_while_let() {
|
|
{
|
|
{
|
|
{
|
|
EvaluateJSReply::NumberValue(
|
|
while let Some(e) = FromJSValConvertible::from_jsval(cx, rval.handle(), ()) {
|
|
unimplemented!();
|
|
},
|
|
)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
fn keep_match() {
|
|
{
|
|
{
|
|
EvaluateJSReply::NumberValue(
|
|
match FromJSValConvertible::from_jsval(cx, rval.handle(), ()) {
|
|
Ok(ConversionResult::Success(v)) => v,
|
|
_ => unreachable!(),
|
|
},
|
|
)
|
|
}
|
|
}
|
|
}
|