summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
Diffstat (limited to 'src/library')
-rw-r--r--src/library/mod.rs2
-rw-r--r--src/library/text.rs1
-rw-r--r--src/library/utility.rs8
3 files changed, 5 insertions, 6 deletions
diff --git a/src/library/mod.rs b/src/library/mod.rs
index a86d8bb3..9e3bf18b 100644
--- a/src/library/mod.rs
+++ b/src/library/mod.rs
@@ -60,9 +60,9 @@ macro_rules! prelude {
prelude! {
pub use std::fmt::{self, Debug, Formatter};
+ pub use std::hash::Hash;
pub use std::num::NonZeroUsize;
pub use std::sync::Arc;
- pub use std::hash::Hash;
pub use typst_macros::class;
diff --git a/src/library/text.rs b/src/library/text.rs
index 05b213c8..4aa1bdec 100644
--- a/src/library/text.rs
+++ b/src/library/text.rs
@@ -1,7 +1,6 @@
//! Text shaping and styling.
use std::borrow::Cow;
-use std::convert::TryInto;
use std::fmt::{self, Debug, Formatter};
use std::ops::{BitXor, Range};
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"