We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cc02d18 commit 421cd45Copy full SHA for 421cd45
src/wire/vec.rs
@@ -45,17 +45,19 @@ where
45
Ctx: Copy,
46
Predicate: FnMut(usize, &T) -> bool,
47
{
48
- if let Some(cap) = capacity
49
- && cap > S
50
- {
51
- return Err(deku_error!(
52
- DekuError::InvalidParam,
53
- "Provided capacity is larger than vector capacity",
54
- "{} exceeds {}",
55
- cap,
56
- S
57
- ));
+ #[allow(clippy::collapsible_if)]
+ if let Some(cap) = capacity {
+ if cap > S {
+ return Err(deku_error!(
+ DekuError::InvalidParam,
+ "Provided capacity is larger than vector capacity",
+ "{} exceeds {}",
+ cap,
+ S
+ ));
58
+ }
59
}
60
+
61
if mem::size_of::<T>() == 0 {
62
return Ok(WireVec::new());
63
0 commit comments