Skip to content

Commit 96072e2

Browse files
committed
Fix 1.97 lints
1 parent 4ba9a3b commit 96072e2

5 files changed

Lines changed: 23 additions & 23 deletions

File tree

draw-cache/benches/draw_cache.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ fn bench_high_position_tolerance(c: &mut Criterion) {
9595
let glyphs = test_glyphs(&FONTS[font_id], TEST_STR);
9696
let mut cache = DrawCache::builder()
9797
.dimensions(1024, 1024)
98-
.scale_tolerance(0.1)
99-
.position_tolerance(1.0)
98+
.scale_tolerance(0.1_f32)
99+
.position_tolerance(1.0_f32)
100100
.build();
101101

102102
{
@@ -368,8 +368,8 @@ fn bench_moving_text(c: &mut Criterion) {
368368

369369
let mut cache = DrawCache::builder()
370370
.dimensions(1500, 1500)
371-
.scale_tolerance(0.1)
372-
.position_tolerance(0.1)
371+
.scale_tolerance(0.1_f32)
372+
.position_tolerance(0.1_f32)
373373
.build();
374374

375375
{
@@ -510,8 +510,8 @@ fn bench_moving_text_thrashing(c: &mut Criterion) {
510510
// re-ordering, re-rasterization & re-uploading has to occur.
511511
let mut cache = DrawCache::builder()
512512
.dimensions(320, 320)
513-
.scale_tolerance(0.1)
514-
.position_tolerance(0.1)
513+
.scale_tolerance(0.1_f32)
514+
.position_tolerance(0.1_f32)
515515
.build();
516516

517517
c.bench_function("moving_text_thrashing_v2", |b| {

draw-cache/src/lib.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,8 +1064,8 @@ mod test {
10641064

10651065
let mut cache = DrawCache::builder()
10661066
.dimensions(32, 32)
1067-
.scale_tolerance(0.1)
1068-
.position_tolerance(0.1)
1067+
.scale_tolerance(0.1_f32)
1068+
.position_tolerance(0.1_f32)
10691069
.pad_glyphs(false)
10701070
.build();
10711071
let strings = [
@@ -1107,8 +1107,8 @@ mod test {
11071107

11081108
let mut cache = DrawCache::builder()
11091109
.dimensions(32, 32)
1110-
.scale_tolerance(0.1)
1111-
.position_tolerance(0.1)
1110+
.scale_tolerance(0.1_f32)
1111+
.position_tolerance(0.1_f32)
11121112
.pad_glyphs(false)
11131113
.build();
11141114

@@ -1130,8 +1130,8 @@ mod test {
11301130
let gid = font.glyph_id('l');
11311131

11321132
let cache = DrawCache::builder()
1133-
.scale_tolerance(0.2)
1134-
.position_tolerance(0.5)
1133+
.scale_tolerance(0.2_f32)
1134+
.position_tolerance(0.5_f32)
11351135
.build();
11361136

11371137
let small = gid.with_scale_and_position(9.91, point(0.0, 0.0));
@@ -1180,8 +1180,8 @@ mod test {
11801180
fn builder_rebuild() {
11811181
let mut cache = DrawCache::builder()
11821182
.dimensions(32, 64)
1183-
.scale_tolerance(0.2)
1184-
.position_tolerance(0.3)
1183+
.scale_tolerance(0.2_f32)
1184+
.position_tolerance(0.3_f32)
11851185
.pad_glyphs(false)
11861186
.align_4x4(true)
11871187
.multithread(true)
@@ -1195,8 +1195,8 @@ mod test {
11951195

11961196
DrawCache::builder()
11971197
.dimensions(64, 128)
1198-
.scale_tolerance(0.05)
1199-
.position_tolerance(0.15)
1198+
.scale_tolerance(0.05_f32)
1199+
.position_tolerance(0.15_f32)
12001200
.pad_glyphs(true)
12011201
.align_4x4(false)
12021202
.multithread(false)
@@ -1226,8 +1226,8 @@ mod test {
12261226

12271227
let mut cache = DrawCache::builder()
12281228
.dimensions(31, 25)
1229-
.scale_tolerance(0.1)
1230-
.position_tolerance(0.1)
1229+
.scale_tolerance(0.1_f32)
1230+
.position_tolerance(0.1_f32)
12311231
.build();
12321232

12331233
let glyphs = glyph_brush_layout::Layout::default_single_line().calculate_glyphs(

gfx-glyph/examples/depth.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ impl App {
157157
Text::new("On top")
158158
.with_scale(95.0)
159159
.with_color([0.8, 0.8, 0.8, 1.0])
160-
.with_z(0.2)
160+
.with_z(0.2_f32)
161161
.with_font_id(ITALIC_FONT),
162162
)
163163
.with_screen_position((width / 2.0, 100.0))
@@ -173,7 +173,7 @@ impl App {
173173
Text::new(&include_str!("lipsum.txt").replace("\n\n", "").repeat(10))
174174
.with_scale(30.0)
175175
.with_color([0.05, 0.05, 0.1, 1.0])
176-
.with_z(1.0),
176+
.with_z(1.0_f32),
177177
)
178178
.with_bounds((width, height)),
179179
);

glyph-brush/src/glyph_brush/builder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ impl GlyphBrushBuilder<()> {
4343
section_hasher: DefaultSectionHasher::default(),
4444
draw_cache_builder: DrawCache::builder()
4545
.dimensions(256, 256)
46-
.scale_tolerance(0.5)
47-
.position_tolerance(0.1)
46+
.scale_tolerance(0.5_f32)
47+
.position_tolerance(0.1_f32)
4848
.align_4x4(false),
4949
}
5050
}

layout/src/lines.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ where
145145
}
146146
}
147147

148-
Some(line).filter(|_| progressed)
148+
progressed.then_some(line)
149149
}
150150
}
151151

0 commit comments

Comments
 (0)