Skip to content

Commit 0c626dd

Browse files
committed
rename objstr::get_value_as_ref to objstr::borrow_value
1 parent 2d22a88 commit 0c626dd

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

vm/src/builtins.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ pub fn builtin_print(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {
596596
)));
597597
}
598598
}
599-
let sep_str = sep_arg.as_ref().map(|obj| objstr::get_value_as_ref(obj));
599+
let sep_str = sep_arg.as_ref().map(|obj| objstr::borrow_value(obj));
600600

601601
// Handle 'end' kwarg:
602602
let end_arg = args
@@ -610,7 +610,7 @@ pub fn builtin_print(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {
610610
)));
611611
}
612612
}
613-
let end_str = end_arg.as_ref().map(|obj| objstr::get_value_as_ref(obj));
613+
let end_str = end_arg.as_ref().map(|obj| objstr::borrow_value(obj));
614614

615615
// Handle 'flush' kwarg:
616616
let flush = if let Some(flush) = &args.get_optional_kwarg("flush") {
@@ -631,7 +631,7 @@ pub fn builtin_print(vm: &mut VirtualMachine, args: PyFuncArgs) -> PyResult {
631631
write!(stdout_lock, " ").unwrap();
632632
}
633633
let v = vm.to_str(&a)?;
634-
let s = objstr::get_value_as_ref(&v);
634+
let s = objstr::borrow_value(&v);
635635
write!(stdout_lock, "{}", s).unwrap();
636636
}
637637

vm/src/obj/objstr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ pub fn get_value(obj: &PyObjectRef) -> String {
111111
}
112112
}
113113

114-
pub fn get_value_as_ref(obj: &PyObjectRef) -> Ref<str> {
114+
pub fn borrow_value(obj: &PyObjectRef) -> Ref<str> {
115115
Ref::map(obj.borrow(), |py_obj| {
116116
if let PyObjectPayload::String { value } = &py_obj.payload {
117117
value.as_ref()

wasm/lib/src/wasm_builtins.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ pub fn format_print_args(vm: &mut VirtualMachine, args: PyFuncArgs) -> Result<St
4444
)));
4545
}
4646
}
47-
let sep_str = sep_arg.as_ref().map(|obj| objstr::get_value_as_ref(obj));
47+
let sep_str = sep_arg.as_ref().map(|obj| objstr::borrow_value(obj));
4848

4949
// Handle 'end' kwarg:
5050
let end_arg = args
@@ -58,7 +58,7 @@ pub fn format_print_args(vm: &mut VirtualMachine, args: PyFuncArgs) -> Result<St
5858
)));
5959
}
6060
}
61-
let end_str = end_arg.as_ref().map(|obj| objstr::get_value_as_ref(obj));
61+
let end_str = end_arg.as_ref().map(|obj| objstr::borrow_value(obj));
6262

6363
// No need to handle 'flush' kwarg, irrelevant when writing to String
6464

0 commit comments

Comments
 (0)