stuff
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use std::{hint::unreachable_unchecked, intrinsics::assume};
|
||||
use std::hint::unreachable_unchecked;
|
||||
|
||||
use crate::{generate_hint, Hint, HINT_EMPTY};
|
||||
|
||||
@@ -70,12 +70,6 @@ impl<'a> AutoComplete<'a> {
|
||||
// Impossible for plural hints to be singular or non-existant
|
||||
debug_assert!(hints.len() > 1); // check on debug
|
||||
|
||||
// Hint to the compiler
|
||||
unsafe {
|
||||
assume(hints.len() > 1);
|
||||
assume(!hints.is_empty());
|
||||
}
|
||||
|
||||
match movement {
|
||||
Movement::Up => {
|
||||
// Wrap self.i to maximum `i` value if needed
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#![feature(const_trait_impl)]
|
||||
#![feature(core_intrinsics)]
|
||||
#![feature(const_mut_refs)]
|
||||
#![feature(const_for)]
|
||||
mod autocomplete;
|
||||
|
||||
@@ -127,6 +127,7 @@ pub fn split_function_chars(chars: &[char], split: SplitType) -> Vec<String> {
|
||||
|
||||
// Append split
|
||||
if curr_c.splitable(c, &prev_char, &split) {
|
||||
// create new buffer
|
||||
data.push(String::new());
|
||||
last = unsafe { data.last_mut().unwrap_unchecked() };
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
use crate::{split_function_chars, SplitType};
|
||||
use std::intrinsics::assume;
|
||||
|
||||
pub const HINT_EMPTY: Hint = Hint::Single("x^2");
|
||||
const HINT_CLOSED_PARENS: Hint = Hint::Single(")");
|
||||
@@ -20,10 +19,6 @@ pub fn generate_hint<'a>(input: &str) -> &'a Hint<'a> {
|
||||
} else {
|
||||
let chars: Vec<char> = input.chars().collect::<Vec<char>>();
|
||||
|
||||
unsafe {
|
||||
assume(!chars.is_empty());
|
||||
}
|
||||
|
||||
let key = get_last_term(&chars);
|
||||
match key {
|
||||
Some(key) => {
|
||||
|
||||
Reference in New Issue
Block a user