aboutsummaryrefslogtreecommitdiffstats
path: root/src/util/identifier.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-10-11 14:06:50 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-10-11 14:06:54 +0200
commit1d8e2b373b5e347a89f05e36c73b04487e04bead (patch)
tree0fc27c9c2adafa3ee841d68ec1334e306babd7b1 /src/util/identifier.rs
parent43edc8fc9d204da962c92b9f9fef45ac8b6b03da (diff)
downloadmarkdown-rs-1d8e2b373b5e347a89f05e36c73b04487e04bead.tar.gz
markdown-rs-1d8e2b373b5e347a89f05e36c73b04487e04bead.tar.bz2
markdown-rs-1d8e2b373b5e347a89f05e36c73b04487e04bead.zip
Refactor some hidden internals
Diffstat (limited to '')
-rw-r--r--src/util/identifier.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/util/identifier.rs b/src/util/identifier.rs
index 4887e02..3c47e20 100644
--- a/src/util/identifier.rs
+++ b/src/util/identifier.rs
@@ -3,11 +3,13 @@
use unicode_id::UnicodeID;
/// Check if a character can start a JS identifier.
+#[must_use]
pub fn id_start(char: char) -> bool {
UnicodeID::is_id_start(char) || matches!(char, '$' | '_')
}
/// Check if a character can continue a JS (or JSX) identifier.
+#[must_use]
pub fn id_cont(char: char, jsx: bool) -> bool {
UnicodeID::is_id_continue(char)
|| matches!(char, '\u{200c}' | '\u{200d}')