summaryrefslogtreecommitdiff
path: root/src/library/utility.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-02-07 14:19:13 +0100
committerLaurenz <laurmaedje@gmail.com>2022-02-07 14:19:13 +0100
commit9730e785a885a4ab5fcc52ce705298654f82f9c2 (patch)
treefcc6c09caf473ad5845f12805d5c914a43f890e2 /src/library/utility.rs
parent5d05c3f68a32c4214661a6807a5358865f54f0af (diff)
Tidy up
Diffstat (limited to 'src/library/utility.rs')
-rw-r--r--src/library/utility.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/library/utility.rs b/src/library/utility.rs
index 5b9831c5..ca9d4350 100644
--- a/src/library/utility.rs
+++ b/src/library/utility.rs
@@ -262,10 +262,10 @@ pub fn upper(_: &mut EvalContext, args: &mut Args) -> TypResult<Value> {
/// Converts an integer into a roman numeral.
///
-/// Works for integer between 0 and 3,999,999 inclusive, returns None otherwise.
-/// Adapted from Yann Villessuzanne's roman.rs under the Unlicense, at
-/// https://github.com/linfir/roman.rs/
+/// Works for integer between 0 and 3,999,999.
pub fn roman(_: &mut EvalContext, args: &mut Args) -> TypResult<Value> {
+ // Adapted from Yann Villessuzanne's roman.rs under the Unlicense, at
+ // https://github.com/linfir/roman.rs/
static PAIRS: &'static [(&'static str, usize)] = &[
("M̅", 1000000),
("D̅", 500000),
@@ -292,7 +292,7 @@ pub fn roman(_: &mut EvalContext, args: &mut Args) -> TypResult<Value> {
let Spanned { mut v, span } = args.expect("non-negative integer")?;
match v {
0_usize => return Ok("N".into()),
- 3_999_999 .. => {
+ 4_000_000 .. => {
bail!(
span,
"cannot convert integers greater than 3,999,999 to roman numerals"