script: to_string() -> into_string()

This commit is contained in:
Manish Goregaokar 2014-12-14 04:16:34 +05:30 committed by Ms2ger
parent 475ff4dcb7
commit e9d1740e19
39 changed files with 152 additions and 152 deletions

View file

@ -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)

View file

@ -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() {

View file

@ -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()))
}
}