summaryrefslogtreecommitdiff
path: root/library/src/text/shift.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2022-11-04 09:30:44 +0100
committerLaurenz <laurmaedje@gmail.com>2022-11-04 11:38:09 +0100
commiteb951c008beea502042db4a3a0e8d1f8b51f6f52 (patch)
tree9856ee4ed0222222669de10e616a580b2a60135e /library/src/text/shift.rs
parent33928a00dc58250e24da1dae4e5db17e7b598d70 (diff)
Style changes
Diffstat (limited to 'library/src/text/shift.rs')
-rw-r--r--library/src/text/shift.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/library/src/text/shift.rs b/library/src/text/shift.rs
index 856d0f96..1117cc00 100644
--- a/library/src/text/shift.rs
+++ b/library/src/text/shift.rs
@@ -78,10 +78,7 @@ fn search_text(content: &Content, mode: ShiftKind) -> Option<EcoString> {
} else if content.is::<SpaceNode>() {
Some(' '.into())
} else if let Some(text) = content.downcast::<TextNode>() {
- if let Some(sup) = convert_script(&text.0, mode) {
- return Some(sup);
- }
- None
+ convert_script(&text.0, mode)
} else if let Some(seq) = content.downcast::<SequenceNode>() {
let mut full = EcoString::new();
for item in seq.0.iter() {
@@ -138,7 +135,7 @@ fn to_superscript_codepoint(c: char) -> Option<char> {
'1' => 0x00B9,
'2' => 0x00B2,
'3' => 0x00B3,
- '4' ..= '9' => 0x2070 + (c as u32 + 4 - '4' as u32),
+ '4'..='9' => 0x2070 + (c as u32 + 4 - '4' as u32),
'+' => 0x207A,
'-' => 0x207B,
'=' => 0x207C,
@@ -155,7 +152,7 @@ fn to_superscript_codepoint(c: char) -> Option<char> {
fn to_subscript_codepoint(c: char) -> Option<char> {
char::from_u32(match c {
'0' => 0x2080,
- '1' ..= '9' => 0x2080 + (c as u32 - '0' as u32),
+ '1'..='9' => 0x2080 + (c as u32 - '0' as u32),
'+' => 0x208A,
'-' => 0x208B,
'=' => 0x208C,