Conversation
WalkthroughThis PR refactors static label-returning methods across the codebase from returning ChangesByte-to-String Slice Return Type Refactoring
Suggested reviewers
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
c1e3732 to
51888f7
Compare
51888f7 to
efde4ec
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/runtime/ffi/abi_type.rs`:
- Around line 278-281: The param_typename method is emitting the wrong label by
calling typename_label(); update param_typename to call param_typename_label()
instead so it writes the correct C parameter type for variants like Uint32T and
Buffer—locate the param_typename(&self, writer: &mut impl std::io::Write) ->
Result<(), bun_core::Error> implementation and replace the call to
self.typename_label() with self.param_typename_label() (keeping the
writer.write_all(...)? and Ok(()) behavior).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: b8933a85-6501-42f4-a6c2-e9ca4e788d20
📒 Files selected for processing (20)
src/install/PackageInstall.rssrc/install/PackageInstaller.rssrc/install/lockfile/Package.rssrc/install/patch_install.rssrc/jsc/ConsoleObject.rssrc/jsc/EventType.rssrc/jsc/JSType.rssrc/runtime/api/bun/spawn/stdio.rssrc/runtime/cli/create/SourceFileProjectGenerator.rssrc/runtime/cli/init_command.rssrc/runtime/ffi/abi_type.rssrc/runtime/server/server_body.rssrc/runtime/shell/subproc.rssrc/runtime/test_runner/pretty_format.rssrc/runtime/webcore/EncodingLabel.rssrc/runtime/webcore/S3Client.rssrc/runtime/webcore/TextDecoder.rssrc/s3_signing/acl.rssrc/s3_signing/credentials.rssrc/s3_signing/storage_class.rs
| pub fn param_typename(self, writer: &mut impl std::io::Write) -> Result<(), bun_core::Error> { | ||
| writer.write_all(self.typename_label())?; | ||
| writer.write_all(self.typename_label().as_bytes())?; | ||
| Ok(()) | ||
| } |
There was a problem hiding this comment.
Bug: param_typename calls wrong method — will emit incorrect type for Uint32T and Buffer.
This calls typename_label() instead of param_typename_label(). For variants where c_type differs from c_param_type (e.g., Uint32T: "uint32_t" vs "int32_t", Buffer: "void*" vs "buffer"), this produces incorrect C output.
🐛 Proposed fix
pub fn param_typename(self, writer: &mut impl std::io::Write) -> Result<(), bun_core::Error> {
- writer.write_all(self.typename_label().as_bytes())?;
+ writer.write_all(self.param_typename_label().as_bytes())?;
Ok(())
}🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/runtime/ffi/abi_type.rs` around lines 278 - 281, The param_typename
method is emitting the wrong label by calling typename_label(); update
param_typename to call param_typename_label() instead so it writes the correct C
parameter type for variants like Uint32T and Buffer—locate the
param_typename(&self, writer: &mut impl std::io::Write) -> Result<(),
bun_core::Error> implementation and replace the call to self.typename_label()
with self.param_typename_label() (keeping the writer.write_all(...)? and Ok(())
behavior).
What does this PR do?
Remove needless
BStrusage for return types that could be static strings.How did you verify your code works?
Trivial conversion.