mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +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> {
|
class ScopeResource<T:send,A> {
|
||||||
let d : ScopeData<T,A>;
|
let d : ScopeData<T,A>;
|
||||||
new(d : ScopeData<T,A>) {
|
new(-d : ScopeData<T,A>) {
|
||||||
self.d = d;
|
self.d = d;
|
||||||
}
|
}
|
||||||
drop unsafe {
|
drop unsafe {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import comm::{port, chan};
|
import comm::{port, chan};
|
||||||
import dom::style;
|
import dom::style;
|
||||||
import option::is_none;
|
import option::is_none;
|
||||||
|
import str::from_bytes;
|
||||||
|
|
||||||
import lexer_util::*;
|
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 comm::{port, chan};
|
||||||
import dom::style;
|
import dom::style;
|
||||||
import option::is_none;
|
import option::is_none;
|
||||||
|
import str::from_bytes;
|
||||||
import lexer_util::*;
|
import lexer_util::*;
|
||||||
|
|
||||||
enum Token {
|
enum Token {
|
||||||
|
@ -81,11 +82,11 @@ impl html_methods for HtmlLexer {
|
||||||
CoeChar(c) {
|
CoeChar(c) {
|
||||||
if c == ('<' as u8) {
|
if c == ('<' as u8) {
|
||||||
self.input_state.unget(c);
|
self.input_state.unget(c);
|
||||||
ret s.to_html_token();
|
ret Text(from_bytes(s));
|
||||||
}
|
}
|
||||||
s += [c];
|
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];
|
attribute_name += [c];
|
||||||
}
|
}
|
||||||
CoeEof {
|
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];
|
attribute_value += [c];
|
||||||
}
|
}
|
||||||
CoeEof {
|
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.
|
// Eat whitespacpe.
|
||||||
self.input_state.eat_whitespace();
|
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 {
|
fn lexer(reader: io::reader, state : ParseState) -> HtmlLexer {
|
||||||
ret { input_state: {mut lookahead: none, reader: reader},
|
ret { input_state: {mut lookahead: none, reader: reader}, mut parser_state: state };
|
||||||
mut parser_state: state };
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[warn(no_non_implicitly_copyable_typarams)]
|
#[warn(no_non_implicitly_copyable_typarams)]
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
import option::is_none;
|
import option::is_none;
|
||||||
|
import str::from_bytes;
|
||||||
|
|
||||||
|
|
||||||
enum CharOrEof {
|
enum CharOrEof {
|
||||||
CoeChar(u8),
|
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 {
|
impl util_methods for InputState {
|
||||||
fn get() -> CharOrEof {
|
fn get() -> CharOrEof {
|
||||||
alt copy self.lookahead {
|
alt copy self.lookahead {
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
#[license = "MPL"];
|
#[license = "MPL"];
|
||||||
#[crate_type = "lib"];
|
#[crate_type = "lib"];
|
||||||
|
|
||||||
|
#[warn(no_old_vecs)];
|
||||||
|
|
||||||
use std;
|
use std;
|
||||||
use sdl;
|
use sdl;
|
||||||
use azure;
|
use azure;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue