Skip to content

Commit da22a93

Browse files
committed
Use min in _set_glyph_flags
1 parent 6680404 commit da22a93

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/buffer.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use alloc::{string::String, vec::Vec};
22
use core::convert::TryFrom;
3+
use std::cmp::min;
34

45
use ttf_parser::GlyphId;
56

@@ -1287,7 +1288,7 @@ impl Buffer {
12871288
from_out_buffer: Option<bool>,
12881289
) {
12891290
let start = start.unwrap_or(0);
1290-
let end = end.unwrap_or(self.len);
1291+
let end = min(end.unwrap_or(self.len), self.len);
12911292
let interior = interior.unwrap_or(false);
12921293
let from_out_buffer = from_out_buffer.unwrap_or(false);
12931294

0 commit comments

Comments
 (0)