You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: extracted some commonly repeated string conversion code to a function
The following code pattern:
let ptr = RSTRING_PTR(val);
let len = RSTRING_LEN(val) as usize;
let slice = std::slice::from_raw_parts(ptr as *const u8, len);
let result = String::from_utf8_lossy(slice).to_string();
Was repeated too often. This was extracted into a function rstring_lossy().
Note that there are other variations to this code pattern. For now, they haven't
been converted to use the function.
No functional changes.
0 commit comments