Skip to content

Commit

Permalink
Update rustc-hash to 2
Browse files Browse the repository at this point in the history
  • Loading branch information
alexheretic committed Jun 18, 2024
1 parent 7b02bc5 commit e00d714
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
1 change: 1 addition & 0 deletions draw-cache/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Unreleased
* Clarify `Rectangle` docs.
* Update _rustc-hash_ to `2`.

# 0.1.5
* Micro-optimise avoid `.round()` during glyph drawing when converting pixel coverage to `u8`.
Expand Down
2 changes: 1 addition & 1 deletion draw-cache/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ readme = "README.md"
[dependencies]
ab_glyph = "0.2.2"
linked-hash-map = "0.5.4"
rustc-hash = "1"
rustc-hash = "2"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
crossbeam-channel = "0.5"
Expand Down
1 change: 1 addition & 0 deletions glyph-brush/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Unreleased
* Add `GlyphCruncher::glyphs` doc example of using `section_index` & `byte_index`.
* Update _rustc-hash_ to `2`.

# v0.7.8
* Update _ordered-float_ to `4`.
Expand Down
2 changes: 1 addition & 1 deletion glyph-brush/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ readme = "README.md"
glyph_brush_draw_cache = { version = "0.1.1", path = "../draw-cache" }
glyph_brush_layout = { version = "0.2.3", path = "../layout" }
ordered-float = "4"
rustc-hash = "1"
rustc-hash = "2"
twox-hash = { version = "1.6.1", default-features = false }

# enable twox-hash rand/std everywhere except wasm
Expand Down
22 changes: 14 additions & 8 deletions layout/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,20 +352,26 @@ impl VerticalAlign {
#[cfg(test)]
mod bounds_test {
use super::*;
use std::f32::INFINITY as inf;

const fn inf() -> f32 {
f32::INFINITY
}

#[test]
fn v_align_y_bounds_inf() {
assert_eq!(VerticalAlign::Top.y_bounds(0.0, inf), (0.0, inf));
assert_eq!(VerticalAlign::Center.y_bounds(0.0, inf), (-inf, inf));
assert_eq!(VerticalAlign::Bottom.y_bounds(0.0, inf), (-inf, 0.0));
assert_eq!(VerticalAlign::Top.y_bounds(0.0, inf()), (0.0, inf()));
assert_eq!(VerticalAlign::Center.y_bounds(0.0, inf()), (-inf(), inf()));
assert_eq!(VerticalAlign::Bottom.y_bounds(0.0, inf()), (-inf(), 0.0));
}

#[test]
fn h_align_x_bounds_inf() {
assert_eq!(HorizontalAlign::Left.x_bounds(0.0, inf), (0.0, inf));
assert_eq!(HorizontalAlign::Center.x_bounds(0.0, inf), (-inf, inf));
assert_eq!(HorizontalAlign::Right.x_bounds(0.0, inf), (-inf, 0.0));
assert_eq!(HorizontalAlign::Left.x_bounds(0.0, inf()), (0.0, inf()));
assert_eq!(
HorizontalAlign::Center.x_bounds(0.0, inf()),
(-inf(), inf())
);
assert_eq!(HorizontalAlign::Right.x_bounds(0.0, inf()), (-inf(), 0.0));
}
}

Expand Down Expand Up @@ -815,7 +821,7 @@ mod layout_test {
let glyphs = Layout::default_wrap().calculate_glyphs(
&*FONT_MAP,
&SectionGeometry {
bounds: (50.0, ::std::f32::INFINITY),
bounds: (50.0, f32::INFINITY),
..SectionGeometry::default()
},
&[
Expand Down

0 comments on commit e00d714

Please sign in to comment.