Skip to content
This repository was archived by the owner on Jul 10, 2023. It is now read-only.

Commit 6f13a13

Browse files
committed
Update to latest Rust
1 parent 789c7a4 commit 6f13a13

File tree

5 files changed

+13
-14
lines changed

5 files changed

+13
-14
lines changed

color.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5-
use std::float::round;
65
use std::libc::types::os::arch::c95::c_double;
76
use std::cmp::Eq;
87

@@ -46,9 +45,9 @@ pub fn hsla(h : float, s : float, l : float, a : float) -> Color {
4645
}
4746
}
4847
49-
let r = round(255.0*hue_to_rgb(m1, m2, h + 1.0/3.0) as c_double);;
50-
let g = round(255.0*hue_to_rgb(m1, m2, h) as c_double);
51-
let b = round(255.0*hue_to_rgb(m1, m2, h - 1.0/3.0) as c_double);
48+
let r = (255.0*hue_to_rgb(m1, m2, h + 1.0/3.0) as c_double).round();
49+
let g = (255.0*hue_to_rgb(m1, m2, h) as c_double).round();
50+
let b = (255.0*hue_to_rgb(m1, m2, h - 1.0/3.0) as c_double).round();
5251
5352
return rgba(r as u8, g as u8, b as u8, a);
5453
}
@@ -106,7 +105,7 @@ pub mod parsing {
106105
107106
// split up r, g, and b
108107
let mut cols = ~[];
109-
for only_colors.split_iter(',').advance |s| {
108+
for s in only_colors.split_iter(',') {
110109
cols.push(s);
111110
};
112111
@@ -126,7 +125,7 @@ pub mod parsing {
126125
127126
// split up r, g, and b
128127
let mut cols = ~[];
129-
for only_vals.split_iter(',').advance |s| {
128+
for s in only_vals.split_iter(',') {
130129
cols.push(s);
131130
};
132131
@@ -146,7 +145,7 @@ pub mod parsing {
146145
147146
// split up h, s, and l
148147
let mut vals = ~[];
149-
for only_vals.split_iter(',').advance |s| {
148+
for s in only_vals.split_iter(',') {
150149
vals.push(s);
151150
};
152151
@@ -165,7 +164,7 @@ pub mod parsing {
165164
let only_vals = color.slice(5u, color.len() - 1);
166165
167166
let mut vals = ~[];
168-
for only_vals.split_iter(',').advance |s| {
167+
for s in only_vals.split_iter(',') {
169168
vals.push(s);
170169
};
171170

parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use netsurfcss::stylesheet::{CssStylesheet, CssStylesheetParams, CssStylesheetPa
1414
use netsurfcss::types::CssLevel21;
1515
use netsurfcss::CssResult;
1616
use wapcaplet::LwcString;
17-
use extra::net::url::Url;
17+
use extra::url::Url;
1818
use netsurfcss::stylesheet::CssUrlResolutionFn;
1919

2020
fn default_params(url: Url) -> CssStylesheetParams {

select.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ impl<N, H: SelectHandler<N>> n::s::CssSelectHandler<N> for SelectHandlerWrapper<
131131
do node_classes_opt.map |s| {
132132
debug!("SelectHandlerWrapper::node_classes - classes: %?", *s);
133133
let mut v = ~[];
134-
for s.split_iter(' ').advance |s| {
135-
debug!("SelectHandlerWrapper::node_classes - class: %?", s);
136-
if s != "" { v.push(lwcstr_from_rust_str(s)) }
134+
for t in s.split_iter(' ') {
135+
debug!("SelectHandlerWrapper::node_classes - class: %?", t);
136+
if t != "" { v.push(lwcstr_from_rust_str(t)) }
137137
}
138138
debug!("SelectHandlerWrapper::classes: %?", v);
139139
v

stylesheet.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
CSS stylesheets, owned types, immutable after creation
77
*/
88

9-
use extra::net::url::Url;
9+
use extra::url::Url;
1010
use util::DataStream;
1111
use netsurfcss::stylesheet::CssStylesheet;
1212
use parser::{parse_stylesheet, parse_style_attribute};

values.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ At least it's consistent though.
1616
*/
1717

1818
use std::cmp::Eq;
19-
use extra::net::url::Url;
19+
use extra::url::Url;
2020
use units::{Length, AbsoluteSize, RelativeSize};
2121
use units::GenericFontFamily;
2222
use color::Color;

0 commit comments

Comments
 (0)