Trim functions
(
mc: &'gc Mutation<'gc>,
receiver: Value<'gc>,
_args: Vec<Value<'gc>>,
)
| 74 | |
| 75 | // Trim functions |
| 76 | fn trim<'gc>( |
| 77 | mc: &'gc Mutation<'gc>, |
| 78 | receiver: Value<'gc>, |
| 79 | _args: Vec<Value<'gc>>, |
| 80 | ) -> Result<Value<'gc>, VmError> { |
| 81 | let s = receiver.as_string_value()?; |
| 82 | let trimmed = s.as_str().trim(); |
| 83 | // Ok(Value::String(mc.intern(trimmed.as_bytes()))) |
| 84 | Ok(Value::IoString(Gc::new(mc, trimmed.to_owned()))) |
| 85 | } |
| 86 | |
| 87 | fn trim_start<'gc>( |
| 88 | mc: &'gc Mutation<'gc>, |
nothing calls this directly
no test coverage detected