Skip to content

Commit 9658ef0

Browse files
committed
Remove unused code
1 parent 937fbb1 commit 9658ef0

File tree

3 files changed

+0
-17
lines changed

3 files changed

+0
-17
lines changed

pyo3-macros-backend/src/method.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -269,21 +269,13 @@ pub struct FnSpec<'a> {
269269
// r# can be removed by syn::ext::IdentExt::unraw()
270270
pub python_name: syn::Ident,
271271
pub signature: FunctionSignature<'a>,
272-
pub output: syn::Type,
273272
pub convention: CallingConvention,
274273
pub text_signature: Option<TextSignatureAttribute>,
275274
pub asyncness: Option<syn::Token![async]>,
276275
pub unsafety: Option<syn::Token![unsafe]>,
277276
pub deprecations: Deprecations<'a>,
278277
}
279278

280-
pub fn get_return_info(output: &syn::ReturnType) -> syn::Type {
281-
match output {
282-
syn::ReturnType::Default => syn::Type::Infer(syn::parse_quote! {_}),
283-
syn::ReturnType::Type(_, ty) => *ty.clone(),
284-
}
285-
}
286-
287279
pub fn parse_method_receiver(arg: &syn::FnArg) -> Result<SelfType> {
288280
match arg {
289281
syn::FnArg::Receiver(
@@ -329,7 +321,6 @@ impl<'a> FnSpec<'a> {
329321
ensure_signatures_on_valid_method(&fn_type, signature.as_ref(), text_signature.as_ref())?;
330322

331323
let name = &sig.ident;
332-
let ty = get_return_info(&sig.output);
333324
let python_name = python_name.as_ref().unwrap_or(name).unraw();
334325

335326
let arguments: Vec<_> = sig
@@ -361,7 +352,6 @@ impl<'a> FnSpec<'a> {
361352
convention,
362353
python_name,
363354
signature,
364-
output: ty,
365355
text_signature,
366356
asyncness: sig.asyncness,
367357
unsafety: sig.unsafety,

pyo3-macros-backend/src/pyclass.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,6 @@ fn impl_complex_enum_struct_variant_cls(
978978
let field_getter = complex_enum_variant_field_getter(
979979
&variant_cls_type,
980980
field_name,
981-
field_type,
982981
field.span,
983982
ctx,
984983
)?;
@@ -1188,7 +1187,6 @@ fn complex_enum_struct_variant_new<'a>(
11881187
name: &format_ident!("__pymethod_constructor__"),
11891188
python_name: format_ident!("__new__"),
11901189
signature,
1191-
output: variant_cls_type.clone(),
11921190
convention: crate::method::CallingConvention::TpNew,
11931191
text_signature: None,
11941192
asyncness: None,
@@ -1202,7 +1200,6 @@ fn complex_enum_struct_variant_new<'a>(
12021200
fn complex_enum_variant_field_getter<'a>(
12031201
variant_cls_type: &'a syn::Type,
12041202
field_name: &'a syn::Ident,
1205-
field_type: &'a syn::Type,
12061203
field_span: Span,
12071204
ctx: &Ctx,
12081205
) -> Result<MethodAndMethodDef> {
@@ -1215,7 +1212,6 @@ fn complex_enum_variant_field_getter<'a>(
12151212
name: field_name,
12161213
python_name: field_name.clone(),
12171214
signature,
1218-
output: field_type.clone(),
12191215
convention: crate::method::CallingConvention::Noargs,
12201216
text_signature: None,
12211217
asyncness: None,

pyo3-macros-backend/src/pyfunction.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,15 +240,12 @@ pub fn impl_wrap_pyfunction(
240240
FunctionSignature::from_arguments(arguments)?
241241
};
242242

243-
let ty = method::get_return_info(&func.sig.output);
244-
245243
let spec = method::FnSpec {
246244
tp,
247245
name: &func.sig.ident,
248246
convention: CallingConvention::from_signature(&signature),
249247
python_name,
250248
signature,
251-
output: ty,
252249
text_signature,
253250
asyncness: func.sig.asyncness,
254251
unsafety: func.sig.unsafety,

0 commit comments

Comments
 (0)