修复19-10代码及其编译返还信息。

pull/872/head
须语 1 week ago
parent a50eb042c8
commit 7b0fa6a4bd

@ -1,13 +1,13 @@
$ cargo run $ cargo run
Compiling patterns v0.1.0 (file:///projects/patterns) Compiling patterns v0.1.0 (file:///projects/patterns)
warning: irrefutable `let...else` pattern warning: irrefutable `if let` pattern
--> src/main.rs:2:5 --> src/main.rs:2:8
| |
2 | let x = 5 else { 2 | if let x = 5 {
| ^^^^^^^^^ | ^^^^^^^^^
| |
= note: this pattern will always match, so the `else` clause is useless = note: this pattern will always match, so the `if let` is useless
= help: consider removing the `else` clause = help: consider replacing the `if let` with a `let`
= note: `#[warn(irrefutable_let_patterns)]` on by default = note: `#[warn(irrefutable_let_patterns)]` on by default
warning: `patterns` (bin "patterns") generated 1 warning warning: `patterns` (bin "patterns") generated 1 warning

@ -1,7 +1,7 @@
fn main() { fn main() {
// ANCHOR: here // ANCHOR: here
if let x = 5 else { if let x = 5 {
return; println!("{x}");
}; };
// ANCHOR_END: here // ANCHOR_END: here
} }

Loading…
Cancel
Save