Rustfmt
This commit is contained in:
parent
dc30a93d61
commit
6bf83540fb
10
src/calc.rs
10
src/calc.rs
@ -11,10 +11,8 @@ use errors::{CalculatorError, CalculatorResult};
|
||||
use operations::{
|
||||
ArithmeticOperation, CalculatorOperation, CalculatorStateChange, MacroState, OpArgs,
|
||||
};
|
||||
use serde::ser::Serializer;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::{BTreeMap, HashMap};
|
||||
use std::collections::{HashSet, VecDeque};
|
||||
use serde::{ser::Serializer, Deserialize, Serialize};
|
||||
use std::collections::{BTreeMap, HashMap, HashSet, VecDeque};
|
||||
use types::{
|
||||
CalculatorAlignment, CalculatorAngleMode, CalculatorConstant, CalculatorConstants,
|
||||
CalculatorDisplayMode, CalculatorMacro, CalculatorMacros, CalculatorRegisters, CalculatorState,
|
||||
@ -307,7 +305,9 @@ impl Calculator {
|
||||
self.state = CalculatorState::WaitingForSetting;
|
||||
Ok(())
|
||||
}
|
||||
c => self.op(OPERATION_MAP.get(&c).ok_or(CalculatorError::NoSuchOperator(c))?),
|
||||
c => self.op(OPERATION_MAP
|
||||
.get(&c)
|
||||
.ok_or(CalculatorError::NoSuchOperator(c))?),
|
||||
}
|
||||
}
|
||||
fn constant_input(&mut self, c: char) -> CalculatorResult<()> {
|
||||
|
@ -4,13 +4,11 @@ mod matrix;
|
||||
mod number;
|
||||
mod vector;
|
||||
use super::errors::{CalculatorError, CalculatorResult};
|
||||
use crate::calc::types::CalculatorAngleMode;
|
||||
use crate::calc::CalculatorDisplayMode;
|
||||
use crate::calc::{types::CalculatorAngleMode, CalculatorDisplayMode};
|
||||
pub use matrix::{Matrix, MatrixDimensions};
|
||||
pub use number::Number;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::cmp::PartialEq;
|
||||
use std::fmt;
|
||||
use std::{cmp::PartialEq, fmt};
|
||||
pub use vector::{Vector, VectorDirection};
|
||||
|
||||
pub trait CalculatorEntry
|
||||
|
@ -1,9 +1,12 @@
|
||||
use super::VectorDirection;
|
||||
use super::{Entry, Number, Vector};
|
||||
use crate::calc::errors::{CalculatorError, CalculatorResult};
|
||||
use crate::calc::types::CalculatorAngleMode;
|
||||
use crate::calc::CalculatorDisplayMode;
|
||||
use crate::CalculatorEntry;
|
||||
use super::{Entry, Number, Vector, VectorDirection};
|
||||
use crate::{
|
||||
calc::{
|
||||
errors::{CalculatorError, CalculatorResult},
|
||||
types::CalculatorAngleMode,
|
||||
CalculatorDisplayMode,
|
||||
},
|
||||
CalculatorEntry,
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::fmt;
|
||||
|
||||
|
@ -1,9 +1,12 @@
|
||||
use super::VectorDirection;
|
||||
use super::{Entry, Matrix, Vector};
|
||||
use crate::calc::errors::{CalculatorError, CalculatorResult};
|
||||
use crate::calc::types::CalculatorAngleMode;
|
||||
use crate::calc::CalculatorDisplayMode;
|
||||
use crate::CalculatorEntry;
|
||||
use super::{Entry, Matrix, Vector, VectorDirection};
|
||||
use crate::{
|
||||
calc::{
|
||||
errors::{CalculatorError, CalculatorResult},
|
||||
types::CalculatorAngleMode,
|
||||
CalculatorDisplayMode,
|
||||
},
|
||||
CalculatorEntry,
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::fmt;
|
||||
|
||||
|
@ -1,8 +1,12 @@
|
||||
use super::{Entry, Matrix, Number};
|
||||
use crate::calc::errors::{CalculatorError, CalculatorResult};
|
||||
use crate::calc::types::CalculatorAngleMode;
|
||||
use crate::calc::CalculatorDisplayMode;
|
||||
use crate::CalculatorEntry;
|
||||
use crate::{
|
||||
calc::{
|
||||
errors::{CalculatorError, CalculatorResult},
|
||||
types::CalculatorAngleMode,
|
||||
CalculatorDisplayMode,
|
||||
},
|
||||
CalculatorEntry,
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::fmt;
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
use confy::ConfyError;
|
||||
use std::error;
|
||||
use std::fmt;
|
||||
use std::{error, fmt};
|
||||
|
||||
pub type CalculatorResult<T> = Result<T, CalculatorError>;
|
||||
|
||||
|
@ -1,7 +1,6 @@
|
||||
use super::entries::Entry;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::HashMap;
|
||||
use std::fmt;
|
||||
use std::{collections::HashMap, fmt};
|
||||
|
||||
/// The calculator state
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
|
@ -1,8 +1,9 @@
|
||||
use std::iter;
|
||||
use std::sync::mpsc;
|
||||
use std::{iter, sync::mpsc};
|
||||
|
||||
use std::thread;
|
||||
use std::time::{Duration, Instant};
|
||||
use std::{
|
||||
thread,
|
||||
time::{Duration, Instant},
|
||||
};
|
||||
|
||||
use crossterm::event::{self, Event as CEvent, KeyEvent};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user