Reformat code with rustfmt

This commit is contained in:
Martin Larralde 2020-04-18 03:59:42 +02:00
parent f36f19cea4
commit b3c937c73a
2 changed files with 7 additions and 3 deletions

View file

@ -121,7 +121,9 @@ pub(crate) fn impl_method_proto(
}
}
}
MethodProto::UnaryS { pyres, proto, arg, .. } => {
MethodProto::UnaryS {
pyres, proto, arg, ..
} => {
let p: syn::Path = syn::parse_str(proto).unwrap();
let (ty, succ) = get_res_success(ty);
@ -131,7 +133,9 @@ pub(crate) fn impl_method_proto(
// update the type if not lifetime was given:
// PyRef<Self> --> PyRef<'p, Self>
if let syn::Type::Path(path) = &mut slf_ty {
if let syn::PathArguments::AngleBracketed(args) = &mut path.path.segments[0].arguments {
if let syn::PathArguments::AngleBracketed(args) =
&mut path.path.segments[0].arguments
{
if let syn::GenericArgument::Lifetime(_) = args.args[0] {
} else {
let lt = syn::parse_quote! {'p};

View file

@ -656,7 +656,7 @@ pub trait TryFromPyCell<'a, T: PyClass>: Sized {
fn try_from_pycell(cell: &'a crate::PyCell<T>) -> Result<Self, Self::Error>;
}
impl <'a, T, R> TryFromPyCell<'a, T> for R
impl<'a, T, R> TryFromPyCell<'a, T> for R
where
T: 'a + PyClass,
R: std::convert::TryFrom<&'a PyCell<T>>,