Remove uneeded imports from py_class.rs
This commit is contained in:
parent
580e50f727
commit
df89720e23
|
@ -1,10 +1,9 @@
|
||||||
// Copyright (c) 2017-present PyO3 Project and Contributors
|
// Copyright (c) 2017-present PyO3 Project and Contributors
|
||||||
|
|
||||||
use std;
|
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
use syn;
|
use syn;
|
||||||
use quote::{Tokens, ToTokens};
|
use quote::Tokens;
|
||||||
|
|
||||||
use utils;
|
use utils;
|
||||||
use method::{FnType, FnSpec, FnArg};
|
use method::{FnType, FnSpec, FnArg};
|
||||||
|
|
|
@ -10,7 +10,7 @@ pub fn build_py_methods(ast: &mut syn::ItemImpl) -> Tokens {
|
||||||
if ast.trait_.is_some() {
|
if ast.trait_.is_some() {
|
||||||
panic!("#[methods] can not be used only with trait impl block");
|
panic!("#[methods] can not be used only with trait impl block");
|
||||||
} else {
|
} else {
|
||||||
impl_methods(&iimpl.self_ty, &mut iimpl.items)
|
impl_methods(&ast.self_ty, &mut ast.items)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ pub fn build_py_proto(ast: &mut syn::ItemImpl) -> Tokens {
|
||||||
let mut seg = path.segments.pop().unwrap().into_value();
|
let mut seg = path.segments.pop().unwrap().into_value();
|
||||||
seg.arguments = syn::PathArguments::AngleBracketed(parse_quote!{<'p>});
|
seg.arguments = syn::PathArguments::AngleBracketed(parse_quote!{<'p>});
|
||||||
path.segments.push(seg);
|
path.segments.push(seg);
|
||||||
expr.generics.params = parse_quote!{'p};
|
ast.generics.params = parse_quote!{'p};
|
||||||
|
|
||||||
tokens
|
tokens
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue