Skip to content

Commit 57c0514

Browse files
committed
refactor(cpp): drop redundant size_t cast in MapLower
wit::map::size() and std::span::size() already return size_t, so the C-style cast was a no-op. Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
1 parent 33bb552 commit 57c0514

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/cpp/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3583,7 +3583,7 @@ impl<'a, 'b> Bindgen for FunctionBindgen<'a, 'b> {
35833583
// layout (see wit-bindgen#1592), so always allocate a fresh ABI
35843584
// buffer rather than reusing the source map's storage.
35853585
self.push_str(&format!("auto&& {val} = {};\n", operands[0]));
3586-
self.push_str(&format!("auto {len} = (size_t)({val}.size());\n"));
3586+
self.push_str(&format!("auto {len} = {val}.size();\n"));
35873587
uwriteln!(
35883588
self.src,
35893589
"auto {ptr} = ({ptr_type})({len} > 0 ? cabi_realloc(nullptr, 0, {align}, {len} * {size}) : nullptr);",

0 commit comments

Comments
 (0)