Skip to main content

luaur_analysis/methods/
lint_format_string_is_digit.rs

1use luaur_common::LUAU_ASSERT;
2
3impl crate::records::lint_format_string::LintFormatString {
4    #[inline]
5    pub fn is_digit(&self, ch: core::ffi::c_char) -> bool {
6        // use unsigned comparison to do range check for performance
7        let _ = self;
8        LUAU_ASSERT!(true);
9        ((ch as u8).wrapping_sub(b'0')) < 10
10    }
11}