diff --git a/conversions.rs b/conversions.rs index d3304d8..62bd50f 100644 --- a/conversions.rs +++ b/conversions.rs @@ -38,7 +38,7 @@ pub trait AsLl { } impl ToLl for CssLanguageLevel { - pub fn to_ll(&self) -> css_language_level { + fn to_ll(&self) -> css_language_level { match *self { CssLevel1 => CSS_LEVEL_1, CssLevel2 => CSS_LEVEL_2, @@ -51,19 +51,19 @@ impl ToLl for CssLanguageLevel { } impl ToLl for CssError { - pub fn to_ll(&self) -> css_error { + fn to_ll(&self) -> css_error { *self as css_error } } impl ToLl for CssFontFamily { - pub fn to_ll(&self) -> css_font_family_e { + fn to_ll(&self) -> css_font_family_e { *self as css_font_family_e } } impl ToLl for CssColor { - pub fn to_ll(&self) -> css_color { + fn to_ll(&self) -> css_color { assert!(sys::size_of::() == sys::size_of::()); unsafe { transmute(*self) } } @@ -75,7 +75,7 @@ pub fn ll_color_to_hl_color(color: css_color) -> CssColor { } impl ToLl<(css_unit, css_fixed)> for CssUnit { - pub fn to_ll(&self) -> (css_unit, css_fixed) { + fn to_ll(&self) -> (css_unit, css_fixed) { use ll::types::*; use types::*; match *self { @@ -156,7 +156,7 @@ pub fn ll_qname_to_hl_qname(qname: *css_qname) -> CssQName { } impl ToLl for CssPseudoElement { - pub fn to_ll(&self) -> css_pseudo_element { + fn to_ll(&self) -> css_pseudo_element { *self as css_pseudo_element } } @@ -168,7 +168,7 @@ pub fn c_enum_to_rust_enum(val: c_enum) -> T { } impl AsLl for CssStylesheetParams { - pub fn as_ll(&self, f: &fn(&css_stylesheet_params) -> U) -> U { + fn as_ll(&self, f: &fn(&css_stylesheet_params) -> U) -> U { do self.charset.to_c_str().with_ref |charset| { do self.url.to_c_str().with_ref |url| { do self.title.to_c_str().with_ref |title| { diff --git a/test.rs b/test.rs index 54d3d13..f180f35 100644 --- a/test.rs +++ b/test.rs @@ -86,7 +86,7 @@ mod example1 { debug!("count sheets: %?", select_ctx.count_sheets()); assert!(select_ctx.count_sheets() == 1); - for hh in range(1, 7) { + for hh in range(1u, 7u) { let element = fmt!("h%u", hh); let element_name: @LwcString = @from_rust_string(element); let node = MyDomNode { name: element_name }; @@ -164,7 +164,7 @@ mod example1 { #[test] fn test_arc() { - use extra::arc::ARC; + use extra::arc::Arc; use stylesheet::*; use types::CssLevel21; use wapcaplet::LwcString; @@ -186,7 +186,7 @@ fn test_arc() { }; let sheet: CssStylesheet = css_stylesheet_create(¶ms); - let _arc = ARC(sheet); + let _arc = Arc::new(sheet); fn resolve_url(_base: &str, _rel: &LwcString) -> CssResult { fail!(~"resolving url");