Commit 6be537f
authored
Fix clippy warning in qpy module (#15951)
This commit fixes a clippy error in the qpy module when running clippy
with the latest stable rust release. In #15698 we denied the use of
unwrap() or expect() to minimize the chance of the qpy module panicking.
We shouldn't ever panic in the qpy module because anything that causes
an error condition was caused by malformed input and should be
reported to the user and be handleable and not cause a hard crash.
However, the clippy check apparently isn't as exhaustive on our MSRV
of 1.85 and it didn't catch the usage of unwrap() in one place. This
is causing a failure when you do run clippy with a newer version of
Rust.
This commit fixes this error by throwing away the error condition. In
this case the call to the `write!()` macro is infallible since it's
just the string format which is infallible unless the underlying write
fails [1]. But since we're writing to a `String` object that we just
allocated in this case there is never a way or this to fail short of a
hardware failure. So to solve the clippy error and prevent it from
becoming a CI failure in the future this commit opts to just discard the
error without using it.
[1] https://doc.rust-lang.org/std/fmt/struct.Error.html1 parent 12bb3ef commit 6be537f
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
0 commit comments