Skip to content

Commit

Permalink
Auto merge of #14532 - frewsxcv:remove-unused-trait, r=Wafflespeanut
Browse files Browse the repository at this point in the history
Remove unused `ExpandToPixelBoundaries` trait from `util`.

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/14532)
<!-- Reviewable:end -->
  • Loading branch information
bors-servo committed Dec 9, 2016
2 parents 120b003 + 586d46d commit e5f995e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
17 changes: 0 additions & 17 deletions components/util/geometry.rs
Expand Up @@ -48,20 +48,3 @@ pub fn au_rect_to_f32_rect(rect: Rect<Au>) -> Rect<f32> {
Rect::new(Point2D::new(rect.origin.x.to_f32_px(), rect.origin.y.to_f32_px()),
Size2D::new(rect.size.width.to_f32_px(), rect.size.height.to_f32_px()))
}

pub trait ExpandToPixelBoundaries {
fn expand_to_px_boundaries(&self) -> Self;
}

impl ExpandToPixelBoundaries for Rect<Au> {
fn expand_to_px_boundaries(&self) -> Rect<Au> {
let bottom_right = self.bottom_right();
let bottom_right = Point2D::new(Au::from_px(bottom_right.x.ceil_to_px()),
Au::from_px(bottom_right.y.ceil_to_px()));
let new_origin = Point2D::new(Au::from_px(self.origin.x.to_px()),
Au::from_px(self.origin.y.to_px()));
Rect::new(new_origin,
Size2D::new(bottom_right.x - new_origin.x,
bottom_right.y - new_origin.y))
}
}
2 changes: 1 addition & 1 deletion components/util/opts.rs
Expand Up @@ -396,7 +396,7 @@ impl DebugOptions {
}


pub fn print_debug_usage(app: &str) -> ! {
fn print_debug_usage(app: &str) -> ! {
fn print_option(name: &str, description: &str) {
println!("\t{:<35} {}", name, description);
}
Expand Down

0 comments on commit e5f995e

Please sign in to comment.