Merge pull request #128 from huitseeker/warts

Maintenance : simplifications & update
This commit is contained in:
MOI Anthony
2020-02-05 12:28:22 -05:00
committed by GitHub
9 changed files with 19 additions and 47 deletions

View File

@@ -23,9 +23,6 @@ impl std::error::Error for PyError {}
pub struct ToPyResult<T>(pub Result<T>);
impl<T> std::convert::Into<PyResult<T>> for ToPyResult<T> {
fn into(self) -> PyResult<T> {
match self.0 {
Ok(o) => Ok(o),
Err(e) => Err(exceptions::Exception::py_err(format!("{}", e))),
}
self.0.map_err(|e| { exceptions::Exception::py_err(format!("{}", e)) })
}
}