mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
script: to_string() -> into_string()
This commit is contained in:
parent
475ff4dcb7
commit
e9d1740e19
39 changed files with 152 additions and 152 deletions
|
@ -679,7 +679,7 @@ def getJSToNativeConversionTemplate(type, descriptorProvider, failureCode=None,
|
|||
default = "None"
|
||||
else:
|
||||
assert defaultValue.type.tag() == IDLType.Tags.domstring
|
||||
value = "str::from_utf8(data).unwrap().to_string()"
|
||||
value = "str::from_utf8(data).unwrap().into_string()"
|
||||
if type.nullable():
|
||||
value = "Some(%s)" % value
|
||||
|
||||
|
@ -2778,7 +2778,7 @@ pub const strings: &'static [&'static str] = &[
|
|||
|
||||
impl ToJSValConvertible for super::%s {
|
||||
fn to_jsval(&self, cx: *mut JSContext) -> JSVal {
|
||||
strings[*self as uint].to_string().to_jsval(cx)
|
||||
strings[*self as uint].into_string().to_jsval(cx)
|
||||
}
|
||||
}
|
||||
""" % (",\n ".join(['"%s"' % val for val in enum.values()]), enum.identifier.name)
|
||||
|
|
|
@ -284,7 +284,7 @@ pub fn jsid_to_str(cx: *mut JSContext, id: jsid) -> DOMString {
|
|||
impl FromJSValConvertible<StringificationBehavior> for DOMString {
|
||||
fn from_jsval(cx: *mut JSContext, value: JSVal, nullBehavior: StringificationBehavior) -> Result<DOMString, ()> {
|
||||
if nullBehavior == StringificationBehavior::Empty && value.is_null() {
|
||||
Ok("".to_string())
|
||||
Ok("".into_string())
|
||||
} else {
|
||||
let jsstr = unsafe { JS_ValueToString(cx, value) };
|
||||
if jsstr.is_null() {
|
||||
|
|
|
@ -154,6 +154,6 @@ impl Hash for ByteString {
|
|||
|
||||
impl FromStr for ByteString {
|
||||
fn from_str(s: &str) -> Option<ByteString> {
|
||||
Some(ByteString::new(s.to_string().into_bytes()))
|
||||
Some(ByteString::new(s.into_string().into_bytes()))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue