We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 15134e6 commit b17a98cCopy full SHA for b17a98c
1 file changed
src/lib.rs
@@ -1036,14 +1036,12 @@ impl AlignedBuf {
1036
if mem::size_of::<usize>() < 8 && capacity > isize::MAX as usize {
1037
Self::capacity_overflow()
1038
}
1039
- let layout = match Layout::from_size_align(capacity, SIMDINPUT_LENGTH) {
1040
- Ok(layout) => layout,
1041
- Err(_) => Self::capacity_overflow(),
+ let Ok(layout) = Layout::from_size_align(capacity, SIMDJSON_PADDING) else {
+ Self::capacity_overflow()
1042
};
1043
1044
- let inner = match unsafe { NonNull::new(alloc(layout)) } {
1045
- Some(ptr) => ptr,
1046
- None => handle_alloc_error(layout),
+ let Some(inner) = (unsafe { NonNull::new(alloc(layout)) }) else {
+ handle_alloc_error(layout)
1047
1048
Self {
1049
layout,
0 commit comments