Fix comments and variable names for atom wrapper.

This commit is contained in:
Glenn Watson 2014-07-17 08:31:31 +10:00
parent dddd3346a6
commit 560e380767
2 changed files with 6 additions and 6 deletions

View file

@ -1273,7 +1273,7 @@ impl Node {
ElementNodeTypeId(..) => {
let element: &JSRef<Element> = ElementCast::to_ref(node).unwrap();
let element = element.deref();
let element = build_element_from_tag(element.local_name.as_slice().into_string(),
let element = build_element_from_tag(element.local_name.as_slice().to_string(),
element.namespace.clone(), &*document);
NodeCast::from_temporary(element)
},

View file

@ -2,9 +2,9 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
// Provides a wrapper around the Atom type in the string cache
// crate. It's needed so that it can implement the Encodable
// trait which is required by Servo.
//! Provides a wrapper around the Atom type in the string cache
//! crate. It's needed so that it can implement the Encodable
//! trait which is required by Servo.
use serialize::{Encoder, Encodable};
use std::fmt;
@ -17,9 +17,9 @@ pub struct Atom {
impl Atom {
#[inline(always)]
pub fn from_slice(string_to_add: &str) -> Atom {
pub fn from_slice(slice: &str) -> Atom {
Atom {
atom: atom::Atom::from_slice(string_to_add)
atom: atom::Atom::from_slice(slice)
}
}
}