Repository: typst/typst
File: crates/typst/src/model/numbering.rs (Rust)

Code before:
                    Ok(num_str) => EcoString::from(num_str),
                    Err(_) => '-'.into(),
                }
            }
            Self::KoreanJamo => zeroless::<14>(
                |x| {
                    [
                        'ㄱ', 'ㄴ', 'ㄷ', 'ㄹ', 'ㅁ', 'ㅂ', 'ㅅ', 'ㅇ', 'ㅈ', 'ㅊ', 'ㅋ',
                        'ㅌ', 'ㅍ', 'ㅎ',
                    ][x]
                },
                n,
            ),
            Self::KoreanSyllable => zeroless::<14>(
                |x| {
                    [
                        '가', '나', '다', '라', '마', '바', '사', '아', '자', '차', '카',
                        '타', '파', '하',
                    ][x]
                },
                n,
            ),
            Self::EasternArabic => decimal('\u{0660}', n),
            Self::EasternArabicPersian => decimal('\u{06F0}', n),
            Self::DevanagariNumber => decimal('\u{0966}', n),
            Self::BengaliNumber => decimal('\u{09E6}',n),
            Self::CircledNumber => zeroless::<50>(
                |x| {
                    [
                        '①', '②', '③', '④', '⑤', '⑥', '⑦', '⑧', '⑨', '⑩', '⑪', '⑫', '⑬',
                        '⑭', '⑮', '⑯', '⑰', '⑱', '⑲', '⑳', '㉑', '㉒', '㉓', '㉔', '㉕',
                        '㉖', '㉗', '㉘', '㉙', '㉚', '㉛', '㉜', '㉝', '㉞', '㉟', '㊱',
                        '㊲', '㊳', '㊴', '㊵', '㊶', '㊷', '㊸', '㊹', '㊺', '㊻', '㊼',
                        '㊽', '㊾', '㊿',
                    ][x]
                },
                n,
            ),
            Self::DoubleCircledNumber => zeroless::<10>(
                |x| ['⓵', '⓶', '⓷', '⓸', '⓹', '⓺', '⓻', '⓼', '⓽', '⓾'][x],
                n,
            ),
        }
    }
}

/// Stringify a number using a base-N counting system with no zero digit.
///
/// This is best explained by example.  Suppose our digits are 'A', 'B', and 'C'.
/// we would get the following:
///

Review comment (suggestion):
```suggestion
            Self::BengaliNumber => decimal('\u{09E6}', n),
```

Code after:
                    Ok(num_str) => EcoString::from(num_str),
                    Err(_) => '-'.into(),
                }
            }
            Self::KoreanJamo => zeroless::<14>(
                |x| {
                    [
                        'ㄱ', 'ㄴ', 'ㄷ', 'ㄹ', 'ㅁ', 'ㅂ', 'ㅅ', 'ㅇ', 'ㅈ', 'ㅊ', 'ㅋ',
                        'ㅌ', 'ㅍ', 'ㅎ',
                    ][x]
                },
                n,
            ),
            Self::KoreanSyllable => zeroless::<14>(
                |x| {
                    [
                        '가', '나', '다', '라', '마', '바', '사', '아', '자', '차', '카',
                        '타', '파', '하',
                    ][x]
                },
                n,
            ),
            Self::EasternArabic => decimal('\u{0660}', n),
            Self::EasternArabicPersian => decimal('\u{06F0}', n),
            Self::DevanagariNumber => decimal('\u{0966}', n),
            Self::BengaliNumber => decimal('\u{09E6}', n),
            Self::CircledNumber => zeroless::<50>(
                |x| {
                    [
                        '①', '②', '③', '④', '⑤', '⑥', '⑦', '⑧', '⑨', '⑩', '⑪', '⑫', '⑬',
                        '⑭', '⑮', '⑯', '⑰', '⑱', '⑲', '⑳', '㉑', '㉒', '㉓', '㉔', '㉕',
                        '㉖', '㉗', '㉘', '㉙', '㉚', '㉛', '㉜', '㉝', '㉞', '㉟', '㊱',
                        '㊲', '㊳', '㊴', '㊵', '㊶', '㊷', '㊸', '㊹', '㊺', '㊻', '㊼',
                        '㊽', '㊾', '㊿',
                    ][x]
                },
                n,
            ),
            Self::DoubleCircledNumber => zeroless::<10>(
                |x| ['⓵', '⓶', '⓷', '⓸', '⓹', '⓺', '⓻', '⓼', '⓽', '⓾'][x],
                n,
            ),
        }
    }
}

/// Stringify a number using a base-N counting system with no zero digit.
///
/// This is best explained by example.  Suppose our digits are 'A', 'B', and 'C'.
/// we would get the following:
///