Skip to content

Commit cf7894e

Browse files
authored
Fix Clippy warning on memory allocation. (proxy-wasm#130)
Signed-off-by: Martijn Swaagman <[email protected]>
1 parent a91ad0d commit cf7894e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/allocator.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
use std::mem::MaybeUninit;
16+
1517
#[cfg(feature = "wee-alloc")]
1618
#[global_allocator]
1719
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
@@ -22,7 +24,7 @@ static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
2224
)]
2325
#[no_mangle]
2426
pub extern "C" fn proxy_on_memory_allocate(size: usize) -> *mut u8 {
25-
let mut vec: Vec<u8> = Vec::with_capacity(size);
27+
let mut vec: Vec<MaybeUninit<u8>> = Vec::with_capacity(size);
2628
unsafe {
2729
vec.set_len(size);
2830
}

0 commit comments

Comments
 (0)