mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Merge pull request #2729 from Ms2ger/warnings
Fix some build warnings in the script crate; r=jack
This commit is contained in:
commit
19522e3366
5 changed files with 8 additions and 11 deletions
|
@ -60,7 +60,7 @@ use std::mem;
|
||||||
pub struct Temporary<T> {
|
pub struct Temporary<T> {
|
||||||
inner: JS<T>,
|
inner: JS<T>,
|
||||||
/// On-stack JS pointer to assuage conservative stack scanner
|
/// On-stack JS pointer to assuage conservative stack scanner
|
||||||
js_ptr: *mut JSObject,
|
_js_ptr: *mut JSObject,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T> PartialEq for Temporary<T> {
|
impl<T> PartialEq for Temporary<T> {
|
||||||
|
@ -74,7 +74,7 @@ impl<T: Reflectable> Temporary<T> {
|
||||||
pub fn new(inner: JS<T>) -> Temporary<T> {
|
pub fn new(inner: JS<T>) -> Temporary<T> {
|
||||||
Temporary {
|
Temporary {
|
||||||
inner: inner,
|
inner: inner,
|
||||||
js_ptr: inner.reflector().get_jsobject(),
|
_js_ptr: inner.reflector().get_jsobject(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -388,8 +388,6 @@ pub struct Root<'a, 'b, T> {
|
||||||
root_list: &'a RootCollection,
|
root_list: &'a RootCollection,
|
||||||
/// Reference to rooted value that must not outlive this container
|
/// Reference to rooted value that must not outlive this container
|
||||||
jsref: JSRef<'b, T>,
|
jsref: JSRef<'b, T>,
|
||||||
/// Pointer to underlying Rust data
|
|
||||||
ptr: *T,
|
|
||||||
/// On-stack JS pointer to assuage conservative stack scanner
|
/// On-stack JS pointer to assuage conservative stack scanner
|
||||||
js_ptr: *mut JSObject,
|
js_ptr: *mut JSObject,
|
||||||
}
|
}
|
||||||
|
@ -405,7 +403,6 @@ impl<'a, 'b, T: Reflectable> Root<'a, 'b, T> {
|
||||||
ptr: unrooted.ptr.clone(),
|
ptr: unrooted.ptr.clone(),
|
||||||
chain: ContravariantLifetime,
|
chain: ContravariantLifetime,
|
||||||
},
|
},
|
||||||
ptr: unrooted.ptr.clone(),
|
|
||||||
js_ptr: unrooted.reflector().get_jsobject(),
|
js_ptr: unrooted.reflector().get_jsobject(),
|
||||||
};
|
};
|
||||||
roots.root(&root);
|
roots.root(&root);
|
||||||
|
|
|
@ -98,7 +98,7 @@ impl<'a> CharacterDataMethods for JSRef<'a, CharacterData> {
|
||||||
let mut data = self.data.deref().borrow().as_slice().slice(0, offset as uint).to_string();
|
let mut data = self.data.deref().borrow().as_slice().slice(0, offset as uint).to_string();
|
||||||
data.push_str(arg.as_slice());
|
data.push_str(arg.as_slice());
|
||||||
data.push_str(self.data.deref().borrow().as_slice().slice((offset + count) as uint, length as uint));
|
data.push_str(self.data.deref().borrow().as_slice().slice((offset + count) as uint, length as uint));
|
||||||
*self.data.deref().borrow_mut() = data.into_owned();
|
*self.data.deref().borrow_mut() = data;
|
||||||
// FIXME: Once we have `Range`, we should implement step7 to step11
|
// FIXME: Once we have `Range`, we should implement step7 to step11
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,7 +103,7 @@ impl HTMLCollection {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let filter = ClassNameFilter {
|
let filter = ClassNameFilter {
|
||||||
classes: split_html_space_chars(classes.as_slice()).map(|class| class.into_owned()).collect()
|
classes: split_html_space_chars(classes.as_slice()).map(|class| class.to_string()).collect()
|
||||||
};
|
};
|
||||||
HTMLCollection::create(window, root, box filter)
|
HTMLCollection::create(window, root, box filter)
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,7 @@ pub fn serialize(iterator: &mut NodeIterator) -> String {
|
||||||
html.push_str(open_elements.pop().unwrap().as_slice());
|
html.push_str(open_elements.pop().unwrap().as_slice());
|
||||||
html.push_str(">");
|
html.push_str(">");
|
||||||
}
|
}
|
||||||
html.into_owned()
|
html
|
||||||
}
|
}
|
||||||
|
|
||||||
fn serialize_comment(comment: &JSRef<Comment>, html: &mut String) {
|
fn serialize_comment(comment: &JSRef<Comment>, html: &mut String) {
|
||||||
|
|
|
@ -157,8 +157,8 @@ pub struct SharedLayoutData {
|
||||||
/// Encapsulates the abstract layout data.
|
/// Encapsulates the abstract layout data.
|
||||||
pub struct LayoutData {
|
pub struct LayoutData {
|
||||||
chan: Option<LayoutChan>,
|
chan: Option<LayoutChan>,
|
||||||
shared_data: SharedLayoutData,
|
_shared_data: SharedLayoutData,
|
||||||
data: *(),
|
_data: *(),
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct LayoutDataRef {
|
pub struct LayoutDataRef {
|
||||||
|
@ -1539,7 +1539,7 @@ impl<'a> NodeMethods for JSRef<'a, Node> {
|
||||||
content.push_str(text.deref().characterdata.data.deref().borrow().as_slice());
|
content.push_str(text.deref().characterdata.data.deref().borrow().as_slice());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Some(content.into_owned())
|
Some(content)
|
||||||
}
|
}
|
||||||
CommentNodeTypeId |
|
CommentNodeTypeId |
|
||||||
TextNodeTypeId |
|
TextNodeTypeId |
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue