(self)
| 180 | } |
| 181 | |
| 182 | pub fn as_string(self) -> Result<InternedString<'gc>, VmError> { |
| 183 | match self { |
| 184 | Value::String(value) => Ok(value), |
| 185 | v => Err(VmError::RuntimeError(format!( |
| 186 | "cannot convert to string, the value is {v}" |
| 187 | ))), |
| 188 | } |
| 189 | } |
| 190 | |
| 191 | // Helper method to convert any string value to a common format |
| 192 | pub fn as_string_value(&self) -> Result<StringValue<'gc>, VmError> { |
no test coverage detected