fn check_trait_decls(decls: &[ItemTrait]) -> Option<TokenStream> {
	let mut checker = CheckTraitDecl { errors: Vec::new() };
	decls.iter().for_each(|decl| visit::visit_item_trait(&mut checker, &decl));

	if checker.errors.is_empty() {
		None
	} else {
		let errors = checker.errors.into_iter().map(|e| e.to_compile_error());
		Some(quote!( #( #errors )* ))
	}
}
/// Check that the trait declarations are in the format we expect.
Check that the trait declarations are in the format we expect.
Check that the trait declarations are in the format we expect .
fn check_trait_decls(decls: &[ItemTrait]) -> Option<TokenStream> {
	let mut checker = CheckTraitDecl { errors: Vec::new() };
	decls.iter().for_each(|decl| visit::visit_item_trait(&mut checker, &decl));
	if checker.errors.is_empty() {
		None
	} else {
		let errors = checker.errors.into_iter().map(|e| e.to_compile_error());
		Some(quote!( #( #errors )* ))
	}
}
fn check_trait_decls ( decls : & [ ItemTrait ] ) -> Option < TokenStream > { let mut checker = CheckTraitDecl { errors : Vec :: new ( ) } ; decls . iter ( ) . for_each ( | decl | visit :: visit_item_trait ( & mut checker , & decl ) ) ; if checker . errors . is_empty ( ) { None } else { let errors = checker . errors . into_iter ( ) . map ( | e | e . to_compile_error ( ) ) ; Some ( quote ! ( ( errors ) ) ) } }
Check that the trait declarations are in the format we expect.
Check that the trait declarations are in the format we expect .
decls
&[ItemTrait]
decls
&[ItemTrait]