aboutsummaryrefslogtreecommitdiff
path: root/src/error.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/error.rs b/src/error.rs
index cd1d7c2..33c6ff8 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -1,5 +1,5 @@
-use std::fmt;
use std::error::Error;
+use std::fmt;
#[derive(Debug)]
pub struct IllegalArgumentException(String);
@@ -24,18 +24,20 @@ impl Error for IllegalArgumentException {
#[derive(Debug)]
pub struct IllegalStateException {
- details: String
+ details: String,
}
impl IllegalStateException {
pub fn new(msg: &str) -> IllegalStateException {
- IllegalStateException{details: msg.to_string()}
+ IllegalStateException {
+ details: msg.to_string(),
+ }
}
}
impl fmt::Display for IllegalStateException {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
- write!(f,"{}",self.details)
+ write!(f, "{}", self.details)
}
}
@@ -43,4 +45,4 @@ impl Error for IllegalStateException {
fn description(&self) -> &str {
&self.details
}
-} \ No newline at end of file
+}