Guard let for rust
```rust
use guardlet::guardlet;
enum Enum { A(String), B(usize), C(Struct), }
struct Struct { foo: String, }
fn eatstring(: String) {}
fn simple_ident() { let v = Enum::A(String::from(""));
guard_let!(v as Enum::A(s), {
// Type of v is Enum at here.
println!("v is not A: {:?}", v);
return;
});
// Type of s is String
eat_string(s)
}
fn pattern() { let v = Enum::A(String::from(""));
guard_let!(v as Enum::C(Struct { foo }), {
// Type of v is Enum at here.
println!("v is not C: {:?}", v);
return;
});
// Type of s is String
eat_string(foo)
}
```
MIT