cleanups
This commit is contained in:
@@ -3,5 +3,6 @@
|
||||
#![feature(const_default_impls)]
|
||||
#![feature(const_mut_refs)]
|
||||
|
||||
mod autocomplete_helper;
|
||||
pub mod parsing;
|
||||
pub mod suggestions;
|
||||
|
||||
@@ -181,12 +181,8 @@ fn prettyify_function_str(func: &str) -> String {
|
||||
/// Case insensitive checks for if `c` is a character used to represent a variable
|
||||
#[inline]
|
||||
pub const fn is_variable(c: &char) -> bool {
|
||||
match c.to_ascii_lowercase() {
|
||||
'x' => true,
|
||||
'e' => true,
|
||||
'π' => true,
|
||||
_ => false,
|
||||
}
|
||||
let c = c.to_ascii_lowercase();
|
||||
(c == 'x') | (c == 'e') | (c == 'π')
|
||||
}
|
||||
|
||||
/// Adds asterisks where needed in a function
|
||||
|
||||
@@ -36,13 +36,11 @@ pub enum SplitType {
|
||||
}
|
||||
|
||||
pub fn split_function_chars(chars: &[char], split: SplitType) -> Vec<String> {
|
||||
if chars.is_empty() {
|
||||
return Vec::new();
|
||||
}
|
||||
|
||||
// No point in processing everything if there's only 1 character
|
||||
if chars.len() == 1 {
|
||||
return vec![chars[0].to_string()];
|
||||
// catch some basic cases
|
||||
match chars.len() {
|
||||
0 => return Vec::new(),
|
||||
1 => return vec![chars[0].to_string()],
|
||||
_ => {}
|
||||
}
|
||||
|
||||
unsafe {
|
||||
|
||||
Reference in New Issue
Block a user