mirror of
https://github.com/notohh/rustlings.git
synced 2024-11-29 16:44:18 -05:00
Fixes the irrefutable let pattern warning
This commit is contained in:
parent
2089901739
commit
cc6a14104d
1 changed files with 5 additions and 7 deletions
|
@ -7,7 +7,8 @@ struct ColorClassicStruct {
|
||||||
|
|
||||||
struct ColorTupleStruct(/* TODO: Something goes here */);
|
struct ColorTupleStruct(/* TODO: Something goes here */);
|
||||||
|
|
||||||
struct ColorUnitStruct;
|
#[derive(Debug)]
|
||||||
|
struct UnitStruct;
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
|
@ -35,12 +36,9 @@ mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
fn unit_structs() {
|
fn unit_structs() {
|
||||||
// TODO: Instantiate a unit struct!
|
// TODO: Instantiate a unit struct!
|
||||||
// let green =
|
// let unit_struct =
|
||||||
|
let message = format!("{:?}s are fun!", unit_struct);
|
||||||
|
|
||||||
if let ColorUnitStruct = green {
|
assert_eq!(message, "UnitStructs are fun!");
|
||||||
assert!(true);
|
|
||||||
} else {
|
|
||||||
assert!(false);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue