mirror of
https://github.com/typst/typst
synced 2025-08-24 19:54:14 +08:00
Use saturating_as
This commit is contained in:
parent
4ad6b4fc64
commit
eebe26ea83
@ -1,5 +1,6 @@
|
|||||||
use std::fmt::{self, Debug, Formatter};
|
use std::fmt::{self, Debug, Formatter};
|
||||||
|
|
||||||
|
use az::SaturatingAs;
|
||||||
use rustybuzz::{BufferFlags, UnicodeBuffer};
|
use rustybuzz::{BufferFlags, UnicodeBuffer};
|
||||||
use ttf_parser::math::{GlyphAssembly, GlyphConstruction, GlyphPart};
|
use ttf_parser::math::{GlyphAssembly, GlyphConstruction, GlyphPart};
|
||||||
use ttf_parser::GlyphId;
|
use ttf_parser::GlyphId;
|
||||||
@ -328,7 +329,7 @@ impl GlyphFragment {
|
|||||||
x_offset: Em::zero(),
|
x_offset: Em::zero(),
|
||||||
y_advance: Em::zero(),
|
y_advance: Em::zero(),
|
||||||
y_offset: Em::zero(),
|
y_offset: Em::zero(),
|
||||||
range: 0..str.len() as u16,
|
range: 0..str.len().saturating_as(),
|
||||||
span: (span, 0),
|
span: (span, 0),
|
||||||
}],
|
}],
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user