field is never read

This commit is contained in:
Simon Gardling 2022-04-08 09:46:56 -04:00
parent e8f86631ce
commit 4494c4c201

View File

@ -3,14 +3,6 @@ use eframe::{egui, epaint};
use egui::{text::CCursor, text_edit::CursorRange, Key, Modifiers, TextEdit, Widget}; use egui::{text::CCursor, text_edit::CursorRange, Key, Modifiers, TextEdit, Widget};
use epaint::text::cursor::{Cursor, PCursor, RCursor}; use epaint::text::cursor::{Cursor, PCursor, RCursor};
#[derive(Clone)]
pub struct AutoComplete<'a> {
pub i: usize,
pub hint: &'a HintEnum<'a>,
pub func_str: Option<String>,
pub changed: bool,
}
#[derive(PartialEq, Debug)] #[derive(PartialEq, Debug)]
enum Movement { enum Movement {
Complete, Complete,
@ -19,6 +11,13 @@ enum Movement {
None, None,
} }
#[derive(Clone)]
pub struct AutoComplete<'a> {
pub i: usize,
pub hint: &'a HintEnum<'a>,
pub func_str: Option<String>,
}
impl Default for Movement { impl Default for Movement {
fn default() -> Movement { Movement::None } fn default() -> Movement { Movement::None }
} }
@ -29,7 +28,6 @@ impl<'a> Default for AutoComplete<'a> {
i: 0, i: 0,
hint: &HintEnum::None, hint: &HintEnum::None,
func_str: None, func_str: None,
changed: true,
} }
} }
} }
@ -38,11 +36,8 @@ impl<'a> AutoComplete<'a> {
fn changed(&mut self, string: &str) { fn changed(&mut self, string: &str) {
let new_func_str = Some(string.to_string()); let new_func_str = Some(string.to_string());
if self.func_str != new_func_str { if self.func_str != new_func_str {
self.changed = true;
self.func_str = new_func_str; self.func_str = new_func_str;
self.hint = generate_hint(string); self.hint = generate_hint(string);
} else {
self.changed = false;
} }
} }