Skip to content

Commit d6b6df5

Browse files
committed
ast::Int::to_usize
1 parent 822cac5 commit d6b6df5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ast/src/builtin.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ impl Int {
4646
pub fn to_u32(&self) -> u32 {
4747
self.0
4848
}
49+
pub fn to_usize(&self) -> usize {
50+
self.0 as _
51+
}
4952
pub fn to_bool(&self) -> bool {
5053
self.0 > 0
5154
}

0 commit comments

Comments
 (0)