mirror of
https://github.com/servo/servo.git
synced 2025-08-01 19:50:30 +01:00
cleaned up more warnings and a few copies
This commit is contained in:
parent
32926f36e0
commit
334102b038
5 changed files with 15 additions and 14 deletions
|
@ -65,7 +65,7 @@ type ScopeData<T:send,A> = {
|
|||
|
||||
class ScopeResource<T:send,A> {
|
||||
let d : ScopeData<T,A>;
|
||||
new(d : ScopeData<T,A>) {
|
||||
new(-d : ScopeData<T,A>) {
|
||||
self.d = d;
|
||||
}
|
||||
drop unsafe {
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import comm::{port, chan};
|
||||
import dom::style;
|
||||
import option::is_none;
|
||||
import str::from_bytes;
|
||||
|
||||
import lexer_util::*;
|
||||
|
||||
|
@ -208,7 +209,7 @@ impl css_methods for CssLexer {
|
|||
}
|
||||
}
|
||||
|
||||
ret Description(desc_name.to_str(), desc_val.to_str());
|
||||
ret Description(from_bytes(desc_name), from_bytes(desc_val));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import comm::{port, chan};
|
||||
import dom::style;
|
||||
import option::is_none;
|
||||
import str::from_bytes;
|
||||
import lexer_util::*;
|
||||
|
||||
enum Token {
|
||||
|
@ -81,11 +82,11 @@ impl html_methods for HtmlLexer {
|
|||
CoeChar(c) {
|
||||
if c == ('<' as u8) {
|
||||
self.input_state.unget(c);
|
||||
ret s.to_html_token();
|
||||
ret Text(from_bytes(s));
|
||||
}
|
||||
s += [c];
|
||||
}
|
||||
CoeEof { ret s.to_html_token(); }
|
||||
CoeEof { ret Text(from_bytes(s)); }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -127,7 +128,8 @@ impl html_methods for HtmlLexer {
|
|||
attribute_name += [c];
|
||||
}
|
||||
CoeEof {
|
||||
ret Attr(attribute_name.to_str(), attribute_name.to_str());
|
||||
let name = from_bytes(attribute_name);
|
||||
ret Attr(copy name, name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -142,7 +144,7 @@ impl html_methods for HtmlLexer {
|
|||
attribute_value += [c];
|
||||
}
|
||||
CoeEof {
|
||||
ret Attr(attribute_name.to_str(), attribute_value.to_str());
|
||||
ret Attr(from_bytes(attribute_name), from_bytes(attribute_value));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -150,13 +152,12 @@ impl html_methods for HtmlLexer {
|
|||
// Eat whitespacpe.
|
||||
self.input_state.eat_whitespace();
|
||||
|
||||
ret Attr(attribute_name.to_str(), attribute_value.to_str());
|
||||
ret Attr(from_bytes(attribute_name), from_bytes(attribute_value));
|
||||
}
|
||||
}
|
||||
|
||||
fn lexer(reader: io::reader, state : ParseState) -> HtmlLexer {
|
||||
ret { input_state: {mut lookahead: none, reader: reader},
|
||||
mut parser_state: state };
|
||||
ret { input_state: {mut lookahead: none, reader: reader}, mut parser_state: state };
|
||||
}
|
||||
|
||||
#[warn(no_non_implicitly_copyable_typarams)]
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
import option::is_none;
|
||||
import str::from_bytes;
|
||||
|
||||
|
||||
enum CharOrEof {
|
||||
CoeChar(u8),
|
||||
|
@ -21,11 +23,6 @@ impl u8_methods for u8 {
|
|||
}
|
||||
}
|
||||
|
||||
impl u8_vec_methods for [u8] {
|
||||
fn to_html_token() -> html_lexer::Token { ret html_lexer::Text(self.to_str()); }
|
||||
fn to_str() -> str { ret str::from_bytes(self); }
|
||||
}
|
||||
|
||||
impl util_methods for InputState {
|
||||
fn get() -> CharOrEof {
|
||||
alt copy self.lookahead {
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
#[license = "MPL"];
|
||||
#[crate_type = "lib"];
|
||||
|
||||
#[warn(no_old_vecs)];
|
||||
|
||||
use std;
|
||||
use sdl;
|
||||
use azure;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue