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

Update to latest Rust #26

Merged
merged 1 commit into from
Aug 8, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* 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/. */

use std::float::round;
use std::libc::types::os::arch::c95::c_double;
use std::cmp::Eq;

Expand Down Expand Up @@ -46,9 +45,9 @@ pub fn hsla(h : float, s : float, l : float, a : float) -> Color {
}
}

let r = round(255.0*hue_to_rgb(m1, m2, h + 1.0/3.0) as c_double);;
let g = round(255.0*hue_to_rgb(m1, m2, h) as c_double);
let b = round(255.0*hue_to_rgb(m1, m2, h - 1.0/3.0) as c_double);
let r = (255.0*hue_to_rgb(m1, m2, h + 1.0/3.0) as c_double).round();
let g = (255.0*hue_to_rgb(m1, m2, h) as c_double).round();
let b = (255.0*hue_to_rgb(m1, m2, h - 1.0/3.0) as c_double).round();

return rgba(r as u8, g as u8, b as u8, a);
}
Expand Down Expand Up @@ -106,7 +105,7 @@ pub mod parsing {

// split up r, g, and b
let mut cols = ~[];
for only_colors.split_iter(',').advance |s| {
for s in only_colors.split_iter(',') {
cols.push(s);
};

Expand All @@ -126,7 +125,7 @@ pub mod parsing {

// split up r, g, and b
let mut cols = ~[];
for only_vals.split_iter(',').advance |s| {
for s in only_vals.split_iter(',') {
cols.push(s);
};

Expand All @@ -146,7 +145,7 @@ pub mod parsing {

// split up h, s, and l
let mut vals = ~[];
for only_vals.split_iter(',').advance |s| {
for s in only_vals.split_iter(',') {
vals.push(s);
};

Expand All @@ -165,7 +164,7 @@ pub mod parsing {
let only_vals = color.slice(5u, color.len() - 1);

let mut vals = ~[];
for only_vals.split_iter(',').advance |s| {
for s in only_vals.split_iter(',') {
vals.push(s);
};

Expand Down
2 changes: 1 addition & 1 deletion parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use netsurfcss::stylesheet::{CssStylesheet, CssStylesheetParams, CssStylesheetPa
use netsurfcss::types::CssLevel21;
use netsurfcss::CssResult;
use wapcaplet::LwcString;
use extra::net::url::Url;
use extra::url::Url;
use netsurfcss::stylesheet::CssUrlResolutionFn;

fn default_params(url: Url) -> CssStylesheetParams {
Expand Down
6 changes: 3 additions & 3 deletions select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@ impl<N, H: SelectHandler<N>> n::s::CssSelectHandler<N> for SelectHandlerWrapper<
do node_classes_opt.map |s| {
debug!("SelectHandlerWrapper::node_classes - classes: %?", *s);
let mut v = ~[];
for s.split_iter(' ').advance |s| {
debug!("SelectHandlerWrapper::node_classes - class: %?", s);
if s != "" { v.push(lwcstr_from_rust_str(s)) }
for t in s.split_iter(' ') {
debug!("SelectHandlerWrapper::node_classes - class: %?", t);
if t != "" { v.push(lwcstr_from_rust_str(t)) }
}
debug!("SelectHandlerWrapper::classes: %?", v);
v
Expand Down
2 changes: 1 addition & 1 deletion stylesheet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
CSS stylesheets, owned types, immutable after creation
*/

use extra::net::url::Url;
use extra::url::Url;
use util::DataStream;
use netsurfcss::stylesheet::CssStylesheet;
use parser::{parse_stylesheet, parse_style_attribute};
Expand Down
2 changes: 1 addition & 1 deletion values.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ At least it's consistent though.
*/

use std::cmp::Eq;
use extra::net::url::Url;
use extra::url::Url;
use units::{Length, AbsoluteSize, RelativeSize};
use units::GenericFontFamily;
use color::Color;
Expand Down