Commit bc26718d authored by Alex Crichton's avatar Alex Crichton
Browse files

Fix all "edition idiom" warnings for 2018

* No longer necessary to `extern crate`
* Add `<'_>` where idiomatic
parent 3e982566
...@@ -4,7 +4,7 @@ use proc_macro2::Ident; ...@@ -4,7 +4,7 @@ use proc_macro2::Ident;
use syn::punctuated::Punctuated; use syn::punctuated::Punctuated;
use syn::spanned::Spanned; use syn::spanned::Spanned;
use syn::token; use syn::token;
use syn::{Attribute, Lit}; use syn::{Attribute, Lit, Token};
use syn::{Block, FieldsNamed, FnArg, ImplItemType, Path, ReturnType, Type}; use syn::{Block, FieldsNamed, FnArg, ImplItemType, Path, ReturnType, Type};
pub struct Program { pub struct Program {
......
...@@ -91,7 +91,7 @@ impl<T> ErrorAppend for Result<T> { ...@@ -91,7 +91,7 @@ impl<T> ErrorAppend for Result<T> {
} }
} }
impl ToError for Spanned { impl ToError for dyn Spanned {
fn to_error<E: Display>(&self, input: E) -> Error { fn to_error<E: Display>(&self, input: E) -> Error {
Error::new(self.span(), input) Error::new(self.span(), input)
} }
......
use crate::hir::names::ParentNames; use crate::hir::names::ParentNames;
use proc_macro2::TokenStream; use proc_macro2::TokenStream;
use quote::ToTokens; use quote::{quote, ToTokens};
pub trait AncestorRefExt { pub trait AncestorRefExt {
type GlibWrapperTokens: ToTokens; type GlibWrapperTokens: ToTokens;
......
...@@ -8,10 +8,10 @@ pub trait Boilerplate<'ast> { ...@@ -8,10 +8,10 @@ pub trait Boilerplate<'ast> {
fn parent_names(&self) -> &ParentNames; fn parent_names(&self) -> &ParentNames;
fn ancestors(&self) -> &[ParentNames]; fn ancestors(&self) -> &[ParentNames];
fn reserved_slot_declarations(&self) -> ReservedSlotDeclarations; fn reserved_slot_declarations(&self) -> ReservedSlotDeclarations;
fn slot_declarations(&self) -> SlotDeclarations; fn slot_declarations(&self) -> SlotDeclarations<'_>;
fn slots(&self) -> &[Slot<'ast>]; fn slots(&self) -> &[Slot<'ast>];
fn fundamental_type(&self) -> ::glib::Type; fn fundamental_type(&self) -> ::glib::Type;
fn properties(&self) -> &[Property]; fn properties(&self) -> &[Property<'_>];
fn overrides(&self) -> Option<&[OverrideItem<'ast>]>; fn overrides(&self) -> Option<&[OverrideItem<'ast>]>;
fn has_private(&self) -> bool; fn has_private(&self) -> bool;
fn private_fields(&self) -> Option<&[&'ast Field]>; fn private_fields(&self) -> Option<&[&'ast Field]>;
......
...@@ -3,7 +3,7 @@ use crate::gen::ancestorext::AncestorRefExt; ...@@ -3,7 +3,7 @@ use crate::gen::ancestorext::AncestorRefExt;
use crate::hir::Property; use crate::hir::Property;
use crate::hir::{Method, Signal, Slot, VirtualMethod}; use crate::hir::{Method, Signal, Slot, VirtualMethod};
use proc_macro2::TokenStream; use proc_macro2::TokenStream;
use quote::ToTokens; use quote::{quote, ToTokens};
use std::iter::FilterMap; use std::iter::FilterMap;
use std::slice::Iter; use std::slice::Iter;
......
...@@ -29,7 +29,7 @@ impl<'ast> Boilerplate<'ast> for Class<'ast> { ...@@ -29,7 +29,7 @@ impl<'ast> Boilerplate<'ast> for Class<'ast> {
ReservedSlotDeclarations(self.class.n_reserved_slots) ReservedSlotDeclarations(self.class.n_reserved_slots)
} }
fn slot_declarations(&self) -> SlotDeclarations { fn slot_declarations(&self) -> SlotDeclarations<'_> {
SlotDeclarations { SlotDeclarations {
InstanceNameFfi: self.class.names.instance_ffi().clone(), InstanceNameFfi: self.class.names.instance_ffi().clone(),
slots: &self.class.slots, slots: &self.class.slots,
...@@ -44,7 +44,7 @@ impl<'ast> Boilerplate<'ast> for Class<'ast> { ...@@ -44,7 +44,7 @@ impl<'ast> Boilerplate<'ast> for Class<'ast> {
::glib::Type::BaseObject ::glib::Type::BaseObject
} }
fn properties(&self) -> &[Property] { fn properties(&self) -> &[Property<'_>] {
&self.class.properties &self.class.properties
} }
...@@ -67,7 +67,7 @@ impl<'ast> Boilerplate<'ast> for Class<'ast> { ...@@ -67,7 +67,7 @@ impl<'ast> Boilerplate<'ast> for Class<'ast> {
impl<'ast> Class<'ast> { impl<'ast> Class<'ast> {
#[cfg_attr(rustfmt, rustfmt_skip)] #[cfg_attr(rustfmt, rustfmt_skip)]
pub fn new(program: &'ast Program, class: &'ast hir::Class) -> Self { pub fn new(program: &'ast Program<'_>, class: &'ast hir::Class<'_>) -> Self {
// This function creates a Class by generating the // This function creates a Class by generating the
// commonly-used symbol names for the class in question, for // commonly-used symbol names for the class in question, for
// example, "FooClass" out of "Foo". // example, "FooClass" out of "Foo".
......
use proc_macro2::{Literal, TokenStream, TokenTree}; use proc_macro2::{Literal, TokenStream, TokenTree};
use quote::{ToTokens, TokenStreamExt}; use quote::{quote, ToTokens, TokenStreamExt};
/// Wraps a `&str` so it can be tokenized as a C-friendly string literal. /// Wraps a `&str` so it can be tokenized as a C-friendly string literal.
/// ///
......
...@@ -11,7 +11,7 @@ use crate::errors::*; ...@@ -11,7 +11,7 @@ use crate::errors::*;
use xml::writer::Result as EmitterResult; use xml::writer::Result as EmitterResult;
pub fn generate(program: &Program) -> Result<()> { pub fn generate(program: &Program<'_>) -> Result<()> {
for class in program.classes.iter() { for class in program.classes.iter() {
generate_gir(class)?; generate_gir(class)?;
} }
...@@ -19,13 +19,13 @@ pub fn generate(program: &Program) -> Result<()> { ...@@ -19,13 +19,13 @@ pub fn generate(program: &Program) -> Result<()> {
Ok(()) Ok(())
} }
pub fn generate_gir(class: &Class) -> Result<()> { pub fn generate_gir(class: &Class<'_>) -> Result<()> {
let mut writer = GeneratorWrite::from(&class.attrs.gir); let mut writer = GeneratorWrite::from(&class.attrs.gir);
generate_gir_xml(class, &mut writer).map_err(|err| class.names.span().to_errors(err))?; generate_gir_xml(class, &mut writer).map_err(|err| class.names.span().to_errors(err))?;
writer.collect_output() writer.collect_output()
} }
fn generate_gir_xml(class: &Class, f: &mut GeneratorWrite) -> EmitterResult<()> { fn generate_gir_xml(class: &Class<'_>, f: &mut GeneratorWrite) -> EmitterResult<()> {
let mut w = EmitterConfig::new().perform_indent(true).create_writer(f); let mut w = EmitterConfig::new().perform_indent(true).create_writer(f);
let name = class.names.instance().to_string(); let name = class.names.instance().to_string();
...@@ -103,7 +103,7 @@ fn generate_gir_xml(class: &Class, f: &mut GeneratorWrite) -> EmitterResult<()> ...@@ -103,7 +103,7 @@ fn generate_gir_xml(class: &Class, f: &mut GeneratorWrite) -> EmitterResult<()>
fn gen_slot_xml( fn gen_slot_xml(
w: &mut EventWriter<&mut GeneratorWrite>, w: &mut EventWriter<&mut GeneratorWrite>,
names: &Names, names: &Names,
slot: &Slot, slot: &Slot<'_>,
) -> EmitterResult<()> { ) -> EmitterResult<()> {
// <method name="add" c:identifier="counter_add"> // <method name="add" c:identifier="counter_add">
// <return-value transfer-ownership="none"> // <return-value transfer-ownership="none">
...@@ -220,7 +220,7 @@ fn gen_constructor_xml( ...@@ -220,7 +220,7 @@ fn gen_constructor_xml(
Ok(()) Ok(())
} }
fn type_to_ctype(type_: &Ty) -> String { fn type_to_ctype(type_: &Ty<'_>) -> String {
match *type_ { match *type_ {
Ty::Integer(_) => "gint".to_string(), Ty::Integer(_) => "gint".to_string(),
Ty::Unit => "void".to_string(), Ty::Unit => "void".to_string(),
......
use proc_macro2::{Ident, TokenStream}; use proc_macro2::{Ident, TokenStream};
use quote::quote;
use syn::Block; use syn::Block;
use crate::glib_utils::*; use crate::glib_utils::*;
use crate::hir::{FnSig, Method, Override, OverrideItem, Signal, Slot, VirtualMethod};
use crate::hir::names::{Names, ParentNames}; use crate::hir::names::{Names, ParentNames};
use crate::hir::{FnSig, Method, Override, OverrideItem, Signal, Slot, VirtualMethod};
pub fn slot_assignments<'ast>(names: &Names, slots: &[Slot<'ast>]) -> Vec<TokenStream> { pub fn slot_assignments<'ast>(names: &Names, slots: &[Slot<'ast>]) -> Vec<TokenStream> {
let InstanceNameFfi = names.instance_ffi(); let InstanceNameFfi = names.instance_ffi();
...@@ -45,7 +45,7 @@ pub fn instance_slot_trampolines<'this, 'ast: 'this>( ...@@ -45,7 +45,7 @@ pub fn instance_slot_trampolines<'this, 'ast: 'this>(
let callback_guard = glib_callback_guard(); let callback_guard = glib_callback_guard();
let InstanceName = names.instance(); let InstanceName = names.instance();
let InstanceNameFfi = names.instance_ffi(); let InstanceNameFfi = names.instance_ffi();
let tokens = |sig: &FnSig, parent_names: Option<&ParentNames>| { let tokens = |sig: &FnSig<'_>, parent_names: Option<&ParentNames>| {
let trampoline_name = names.slot_trampoline(&sig.name); let trampoline_name = names.slot_trampoline(&sig.name);
let method_impl_name = names.slot_impl(&sig.name); let method_impl_name = names.slot_impl(&sig.name);
let inputs = sig.input_args_with_glib_types(); let inputs = sig.input_args_with_glib_types();
...@@ -117,7 +117,7 @@ pub fn slot_default_handlers<'this, 'ast: 'this>( ...@@ -117,7 +117,7 @@ pub fn slot_default_handlers<'this, 'ast: 'this>(
slots: &'this [Slot<'ast>], slots: &'this [Slot<'ast>],
overrides: impl Iterator<Item = &'this OverrideItem<'ast>>, overrides: impl Iterator<Item = &'this OverrideItem<'ast>>,
) -> Vec<TokenStream> { ) -> Vec<TokenStream> {
let method = |sig: &FnSig, body: &Block, name: Option<&Ident>| { let method = |sig: &FnSig<'_>, body: &Block, name: Option<&Ident>| {
let name = if let Some(name) = name { let name = if let Some(name) = name {
name.clone() name.clone()
} else { } else {
......
use super::boilerplate; use super::boilerplate;
use crate::gen::boilerplateext::BoilerplateExt; use crate::gen::boilerplateext::BoilerplateExt;
use proc_macro2::TokenStream; use proc_macro2::TokenStream;
use quote::ToTokens; use quote::{quote, ToTokens};
use std::marker::PhantomData; use std::marker::PhantomData;
pub struct Instance<'lt, 'ast: 'lt, Boilerplate: boilerplate::Boilerplate<'ast> + 'lt> { pub struct Instance<'lt, 'ast: 'lt, Boilerplate: boilerplate::Boilerplate<'ast>> {
boilerplate: &'lt Boilerplate, boilerplate: &'lt Boilerplate,
phantom: PhantomData<&'ast ()>, phantom: PhantomData<&'ast ()>,
} }
......
use proc_macro2::TokenStream; use proc_macro2::TokenStream;
use quote::ToTokens; use quote::{quote, ToTokens};
use crate::hir::{Method, Slot, Ty, VirtualMethod}; use crate::hir::{Method, Slot, Ty, VirtualMethod};
......
...@@ -31,7 +31,7 @@ impl<'ast> Boilerplate<'ast> for Interface<'ast> { ...@@ -31,7 +31,7 @@ impl<'ast> Boilerplate<'ast> for Interface<'ast> {
ReservedSlotDeclarations(0) ReservedSlotDeclarations(0)
} }
fn slot_declarations(&self) -> SlotDeclarations { fn slot_declarations(&self) -> SlotDeclarations<'_> {
SlotDeclarations { SlotDeclarations {
InstanceNameFfi: self.iface.names.instance_ffi(), InstanceNameFfi: self.iface.names.instance_ffi(),
slots: &self.iface.slots, slots: &self.iface.slots,
...@@ -46,7 +46,7 @@ impl<'ast> Boilerplate<'ast> for Interface<'ast> { ...@@ -46,7 +46,7 @@ impl<'ast> Boilerplate<'ast> for Interface<'ast> {
::glib::Type::BaseInterface ::glib::Type::BaseInterface
} }
fn properties(&self) -> &[Property] { fn properties(&self) -> &[Property<'_>] {
&self.iface.properties &self.iface.properties
} }
...@@ -68,7 +68,7 @@ impl<'ast> Boilerplate<'ast> for Interface<'ast> { ...@@ -68,7 +68,7 @@ impl<'ast> Boilerplate<'ast> for Interface<'ast> {
} }
impl<'ast> Interface<'ast> { impl<'ast> Interface<'ast> {
pub fn new(program: &'ast Program, iface: &'ast hir::Interface) -> Self { pub fn new(program: &'ast Program<'_>, iface: &'ast hir::Interface<'_>) -> Self {
let parent_names = ParentNames::new_from_glib(::glib::Type::BaseInterface); let parent_names = ParentNames::new_from_glib(::glib::Type::BaseInterface);
Interface { Interface {
......
...@@ -33,7 +33,7 @@ use crate::hir::Program; ...@@ -33,7 +33,7 @@ use crate::hir::Program;
pub use self::ancestorext::AncestorRefExt; pub use self::ancestorext::AncestorRefExt;
pub fn codegen(program: &Program) -> TokenStream { pub fn codegen(program: &Program<'_>) -> TokenStream {
let mut writer = RustWriter::new(); let mut writer = RustWriter::new();
program.classes.iter().for_each(|class| { program.classes.iter().for_each(|class| {
......
//! This file contains the instantion of all the data that is instantiated once
//! and stored in a static variable
use crate::gen::boilerplate; use crate::gen::boilerplate;
use crate::gen::boilerplateext::BoilerplateExt; use crate::gen::boilerplateext::BoilerplateExt;
use crate::hir::{Override, OverrideItem}; use crate::hir::{Override, OverrideItem};
/// ! This file contains the instantion of all the data that is instantiated once
/// ! and stored in a static variable
use proc_macro2::TokenStream; use proc_macro2::TokenStream;
use quote::ToTokens; use quote::{quote, ToTokens};
use std::marker::PhantomData; use std::marker::PhantomData;
pub struct PrivateStatic<'lt, 'ast: 'lt, Boilerplate: boilerplate::Boilerplate<'ast> + 'lt> { pub struct PrivateStatic<'lt, 'ast: 'lt, Boilerplate: boilerplate::Boilerplate<'ast>> {
boilerplate: &'lt Boilerplate, boilerplate: &'lt Boilerplate,
phantom: PhantomData<&'ast ()>, phantom: PhantomData<&'ast ()>,
} }
......
use proc_macro2::{Ident, TokenStream}; use proc_macro2::{Ident, TokenStream};
use quote::quote;
use crate::gen::PropertyGenExt; use crate::gen::PropertyGenExt;
use crate::hir::{Property, Ty}; use crate::hir::{Property, Ty};
......
use crate::hir::{Property, Ty}; use crate::hir::{Property, Ty};
use crate::ident_ext::IdentExt; use crate::ident_ext::IdentExt;
use proc_macro2::TokenStream; use proc_macro2::TokenStream;
use quote::quote;
use syn::Lit; use syn::Lit;
pub trait PropertyGenExt<'ast> { pub trait PropertyGenExt<'ast> {
......
...@@ -3,18 +3,18 @@ use super::instance_ext; ...@@ -3,18 +3,18 @@ use super::instance_ext;
use super::properties; use super::properties;
use crate::gen::boilerplateext::BoilerplateExt; use crate::gen::boilerplateext::BoilerplateExt;
use proc_macro2::TokenStream; use proc_macro2::TokenStream;
use quote::ToTokens; use quote::{quote, ToTokens};
use std::marker::PhantomData; use std::marker::PhantomData;
/// This class can generate the public part of the boilerplate code for objects /// This class can generate the public part of the boilerplate code for objects
pub struct Public<'lt, 'ast: 'lt, Boilerplate: boilerplate::Boilerplate<'ast> + 'lt> { pub struct Public<'lt, 'ast: 'lt, Boilerplate: boilerplate::Boilerplate<'ast>> {
boilerplate: &'lt Boilerplate, boilerplate: &'lt Boilerplate,
phantom: PhantomData<&'ast ()>, phantom: PhantomData<&'ast ()>,
} }
/// This class can generate the public part of the boilerplate code for objects /// This class can generate the public part of the boilerplate code for objects
/// The code is expected to be inserted into the "imp"-mod /// The code is expected to be inserted into the "imp"-mod
pub struct PublicImp<'lt, 'ast: 'lt, Boilerplate: boilerplate::Boilerplate<'ast> + 'lt> { pub struct PublicImp<'lt, 'ast: 'lt, Boilerplate: boilerplate::Boilerplate<'ast>> {
boilerplate: &'lt Boilerplate, boilerplate: &'lt Boilerplate,
phantom: PhantomData<&'ast ()>, phantom: PhantomData<&'ast ()>,
} }
......
use proc_macro2::{Ident, TokenStream}; use proc_macro2::{Ident, TokenStream};
use quote::quote;
use std::char; use std::char;
use syn::Path; use syn::Path;
use crate::glib_utils::*;
use crate::hir::{FnArg, Signal, Ty};
use super::super::ident_ext::IdentExt; use super::super::ident_ext::IdentExt;
use super::cstringliteral::CStringLiteral; use super::cstringliteral::CStringLiteral;
use crate::glib_utils::*;
use crate::hir::names::Names; use crate::hir::names::Names;
use crate::hir::{FnArg, Signal, Ty};
pub fn signal_emit_methods<'ast>( pub fn signal_emit_methods<'ast>(
signals: impl Iterator<Item = &'ast Signal<'ast>>, signals: impl Iterator<Item = &'ast Signal<'ast>>,
...@@ -176,25 +175,25 @@ pub fn signal_trampolines<'ast>( ...@@ -176,25 +175,25 @@ pub fn signal_trampolines<'ast>(
/// From a signal called `foo`, generate `foo_signal_id`. This is used to /// From a signal called `foo`, generate `foo_signal_id`. This is used to
/// store the signal ids from g_signal_newv() in the Class structure. /// store the signal ids from g_signal_newv() in the Class structure.
fn signal_id_name<'ast>(signal: &'ast Signal) -> Ident { fn signal_id_name<'ast>(signal: &'ast Signal<'_>) -> Ident {
Ident::from_str(format!("{}_signal_id", signal.sig.name)) Ident::from_str(format!("{}_signal_id", signal.sig.name))
} }
/// From a signal called `foo` generate a `foo_trampoline` identifier. This is used /// From a signal called `foo` generate a `foo_trampoline` identifier. This is used
/// for the functions that get passed to g_signal_connect(). /// for the functions that get passed to g_signal_connect().
pub fn signal_trampoline_name(signal: &Signal) -> Ident { pub fn signal_trampoline_name(signal: &Signal<'_>) -> Ident {
Ident::from_str(format!("{}_signal_handler_trampoline", signal.sig.name)) Ident::from_str(format!("{}_signal_handler_trampoline", signal.sig.name))
} }
/// From a signal called `foo` generate a `connect_foo` identifier. This is used /// From a signal called `foo` generate a `connect_foo` identifier. This is used
/// for the public methods in the InstanceExt trait. /// for the public methods in the InstanceExt trait.
pub fn connect_signalname(signal: &Signal) -> Ident { pub fn connect_signalname(signal: &Signal<'_>) -> Ident {
Ident::from_str(format!("connect_{}", signal.sig.name)) Ident::from_str(format!("connect_{}", signal.sig.name))
} }
/// From a signal called `foo` generate a `emit_foo` identifier. This is used /// From a signal called `foo` generate a `emit_foo` identifier. This is used
/// for the user's implementations of methods. /// for the user's implementations of methods.
fn emit_signalname(signal: &Signal) -> Ident { fn emit_signalname(signal: &Signal<'_>) -> Ident {
Ident::from_str(format!("emit_{}", signal.sig.name)) Ident::from_str(format!("emit_{}", signal.sig.name))
} }
...@@ -217,8 +216,8 @@ pub fn canonicalize_signal_name(name: &str) -> Result<String, ()> { ...@@ -217,8 +216,8 @@ pub fn canonicalize_signal_name(name: &str) -> Result<String, ()> {
for c in name.chars() { for c in name.chars() {
canon.push(match c { canon.push(match c {
'a'...'z' => c, 'a'..='z' => c,
'A'...'Z' => char::from_u32(u32::from(c) + u32::from('a') - u32::from('A')).unwrap(), 'A'..='Z' => char::from_u32(u32::from(c) + u32::from('a') - u32::from('A')).unwrap(),
_ => return Err(()), _ => return Err(()),
}); });
...@@ -227,9 +226,9 @@ pub fn canonicalize_signal_name(name: &str) -> Result<String, ()> { ...@@ -227,9 +226,9 @@ pub fn canonicalize_signal_name(name: &str) -> Result<String, ()> {
for c in name.chars().skip(1) { for c in name.chars().skip(1) {
canon.push(match c { canon.push(match c {
'0'...'9' => c, '0'..='9' => c,
'a'...'z' => c, 'a'..='z' => c,
'A'...'Z' => char::from_u32(u32::from(c) + u32::from('a') - u32::from('A')).unwrap(), 'A'..='Z' => char::from_u32(u32::from(c) + u32::from('a') - u32::from('A')).unwrap(),
'_' | '-' => '-', '_' | '-' => '-',
_ => return Err(()), _ => return Err(()),
}); });
......
use proc_macro2::{Span, TokenStream}; use proc_macro2::{Span, TokenStream};
use quote::ToTokens; use quote::{quote, ToTokens};
use syn::Token;
use crate::hir::{FnArg, FnSig, Ty}; use crate::hir::{FnArg, FnSig, Ty};
......
use proc_macro2::{Ident, TokenStream}; use proc_macro2::{Ident, TokenStream};
use quote::ToTokens; use quote::{quote, ToTokens};
use crate::hir::{Slot, VirtualMethod}; use crate::hir::{Slot, VirtualMethod};
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
use crate::ast; use crate::ast;
use proc_macro2::TokenStream; use proc_macro2::TokenStream;
use quote::ToTokens; use quote::{quote, ToTokens};
pub fn tokens_GObject() -> TokenStream { pub fn tokens_GObject() -> TokenStream {
quote! { glib::Object } quote! { glib::Object }
......
...@@ -46,7 +46,7 @@ impl<'ast> Classes<'ast> { ...@@ -46,7 +46,7 @@ impl<'ast> Classes<'ast> {
self.items.len() self.items.len()
} }
pub fn get(&self, name: &str) -> &Class { pub fn get(&self, name: &str) -> &Class<'_> {
self.items.iter().find(|c| c.1.names == name).unwrap().1 self.items.iter().find(|c| c.1.names == name).unwrap().1
} }
...@@ -77,7 +77,7 @@ impl<'ast> Classes<'ast> { ...@@ -77,7 +77,7 @@ impl<'ast> Classes<'ast> {
Ok(()) Ok(())
} }
fn add_impl_method(item: &'ast ast::ImplItemMethod) -> Result<Method> { fn add_impl_method(item: &'ast ast::ImplItemMethod) -> Result<Method<'_>> {
if let Some(spanned) = &item.signal { if let Some(spanned) = &item.signal {
return spanned return spanned
.span() .span()
...@@ -203,7 +203,7 @@ impl<'ast> Classes<'ast> { ...@@ -203,7 +203,7 @@ impl<'ast> Classes<'ast> {
res res
} }
pub fn iter<'a>(&'a self) -> impl Iterator<Item = &'a Class> + 'a { pub fn iter<'a>(&'a self) -> impl Iterator<Item = &'a Class<'_>> + 'a {
self.items.values() self.items.values()
} }
} }
......