Fix Clippy warnings for Rust 1.51

This commit is contained in:
Anthony MOI
2021-04-02 17:18:19 -04:00
committed by Anthony MOI
parent 659a835d04
commit e1627654b4
9 changed files with 49 additions and 53 deletions

View File

@ -23,10 +23,9 @@ impl Display for PyError {
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> {
self.0
.map_err(|e| exceptions::PyException::new_err(format!("{}", e)))
impl<T> From<ToPyResult<T>> for PyResult<T> {
fn from(v: ToPyResult<T>) -> Self {
v.0.map_err(|e| exceptions::PyException::new_err(format!("{}", e)))
}
}
impl<T> ToPyResult<T> {