|
|
|
|
|
by masklinn
4685 days ago
|
|
> Also, does the compiler complain about my example above being not exhaustive? Yes, although the error message isn't very good: crypto.rs:55:23: 59:5 error: non-exhaustive patterns: true not covered
crypto.rs:55 let computed_key = match (key.len() > self.block_size, key.len() < self.block_size) {
crypto.rs:56 (true, false) => self.zero_pad(self.hash(key).digest),
crypto.rs:57 (false, true) => self.zero_pad(key),
crypto.rs:58 (false, false) => key
crypto.rs:59 };
error: aborting due to previous error
And technically that's not a good thing, since (true, true) is not possible considering the input. |
|