fn question_answered(&mut self)
	{
		let mut notification_vec = Vec::new();
		{
			let answer = self.yn_question_state.clone();
			let question = match self.yn_question
			{
				None => {return;},
				Some(ref v) => {
					v
				}
			};
			let ref option = question.option;
			match *option
			{
				YNOption::NewIgnoreModified => {
					if answer == true
					{
						self.data.clear();
					}
				},
				YNOption::OpenIgnoreModified(ref path) => {
					if answer == true
					{
						match self.data.open(path.clone())
			    		{
			    			Ok(_) => {
			    				notification_vec.push(format!("opened"));
			    			},
			    			Err(e) => {
			    				notification_vec.push(format!("error: {}", e));
			    			}
			    		}
					}
				},
				YNOption::SaveIgnoreExisting(ref path) => {
					if answer == true
					{
						match self.data.save_to(path.clone())
						{
							Ok(_) => {
								notification_vec.push(format!("saved"));
							},
							Err(e) => {
								notification_vec.push(format!("error: {}", e));
							}
						}
					}
				},
				YNOption::QuitIgnoreModified => {
					if answer == true
					{
						self.running = false;
					}
				}
			}
		}
		for notification in notification_vec
		{
			self.notify(notification);
		}
		self.yn_question = None;
	}
//called when the user confirms an answer (enter)
//if the user confirms the action it executes what should have been executed before,
//this action is stored in self.yn_question.option
called when the user confirms an answer (enter)
if the user confirms the action it executes what should have been executed before,
this action is stored in self.yn_question.option
called when the user confirms an answer ( enter ) if the user confirms the action it executes what should have been executed before this action is stored in self . yn_question . option
fn question_answered(&mut self)
	{
		let mut notification_vec = Vec::new();
		{
			let answer = self.yn_question_state.clone();
			let question = match self.yn_question
			{
				None => {return;},
				Some(ref v) => {
					v
				}
			};
			let ref option = question.option;
			match *option
			{
				YNOption::NewIgnoreModified => {
					if answer == true
					{
						self.data.clear();
					}
				},
				YNOption::OpenIgnoreModified(ref path) => {
					if answer == true
					{
						match self.data.open(path.clone())
			    		{
			    			Ok(_) => {
			    				notification_vec.push(format!("opened"));
			    			},
			    			Err(e) => {
			    				notification_vec.push(format!("error: {}", e));
			    			}
			    		}
					}
				},
				YNOption::SaveIgnoreExisting(ref path) => {
					if answer == true
					{
						match self.data.save_to(path.clone())
						{
							Ok(_) => {
								notification_vec.push(format!("saved"));
							},
							Err(e) => {
								notification_vec.push(format!("error: {}", e));
							}
						}
					}
				},
				YNOption::QuitIgnoreModified => {
					if answer == true
					{
						self.running = false;
					}
				}
			}
		}
		for notification in notification_vec
		{
			self.notify(notification);
		}
		self.yn_question = None;
	}
fn question_answered ( & mut self ) { let mut notification_vec = Vec :: new ( ) ; { let answer = self . yn_question_state . clone ( ) ; let question = match self . yn_question { None => { return ; } , Some ( ref v ) => { v } } ; let ref option = question . option ; match * option { YNOption :: NewIgnoreModified => { if answer == true { self . data . clear ( ) ; } } , YNOption :: OpenIgnoreModified ( ref path ) => { if answer == true { match self . data . open ( path . clone ( ) ) { Ok ( _ ) => { notification_vec . push ( format ! ( " " ) ) ; } , Err ( e ) => { notification_vec . push ( format ! ( " " e ) ) ; } } } } , YNOption :: SaveIgnoreExisting ( ref path ) => { if answer == true { match self . data . save_to ( path . clone ( ) ) { Ok ( _ ) => { notification_vec . push ( format ! ( " " ) ) ; } , Err ( e ) => { notification_vec . push ( format ! ( " " e ) ) ; } } } } , YNOption :: QuitIgnoreModified => { if answer == true { self . running = false ; } } } } for notification in notification_vec { self . notify ( notification ) ; } self . yn_question = None ; }
called when the user confirms an answer (enter)
if the user confirms the action it executes what should have been executed before,
this action is stored in self.yn_question.option
called when the user confirms an answer ( enter ) if the user confirms the action it executes what should have been executed before this action is stored in self . yn_question . option
&mut self
&mut self