fix: formatting
This commit is contained in:
+10
-6
@@ -5,26 +5,28 @@ use std::fmt;
|
||||
/// Error to be raised when model does not fits data.
|
||||
#[derive(Debug)]
|
||||
pub struct FitFailedError {
|
||||
details: String
|
||||
details: String,
|
||||
}
|
||||
|
||||
/// Error to be raised when model prediction cannot be calculated.
|
||||
#[derive(Debug)]
|
||||
pub struct PredictFailedError {
|
||||
details: String
|
||||
details: String,
|
||||
}
|
||||
|
||||
impl FitFailedError {
|
||||
/// Creates new instance of `FitFailedError`
|
||||
/// * `msg` - description of the error
|
||||
pub fn new(msg: &str) -> FitFailedError {
|
||||
FitFailedError{details: msg.to_string()}
|
||||
FitFailedError {
|
||||
details: msg.to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for FitFailedError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f,"{}",self.details)
|
||||
write!(f, "{}", self.details)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,13 +40,15 @@ impl PredictFailedError {
|
||||
/// Creates new instance of `PredictFailedError`
|
||||
/// * `msg` - description of the error
|
||||
pub fn new(msg: &str) -> PredictFailedError {
|
||||
PredictFailedError{details: msg.to_string()}
|
||||
PredictFailedError {
|
||||
details: msg.to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for PredictFailedError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
write!(f,"{}",self.details)
|
||||
write!(f, "{}", self.details)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user