xtask: fix getters source order

Generate getters in the same order as the fields they access. Avoids git
noise and makes for better docs.
pull/1/head
Alessandro Decina 4 years ago
parent 25170a539b
commit 1bb3846071

File diff suppressed because it is too large Load Diff

@ -9,4 +9,5 @@ structopt = {version = "0.3", default-features = false }
anyhow = "1" anyhow = "1"
syn = {version = "1", features = ["visit-mut", "extra-traits"] } syn = {version = "1", features = ["visit-mut", "extra-traits"] }
quote = "1" quote = "1"
proc-macro2 = "1" proc-macro2 = "1"
indexmap = "1.6"

@ -1,5 +1,4 @@
use std::collections::HashMap; use indexmap::IndexMap;
use proc_macro2::{Span, TokenStream}; use proc_macro2::{Span, TokenStream};
use quote::{quote, TokenStreamExt}; use quote::{quote, TokenStreamExt};
use syn::{ use syn::{
@ -9,7 +8,7 @@ use syn::{
pub struct GetterList<'a> { pub struct GetterList<'a> {
slf: Ident, slf: Ident,
item_fields: HashMap<Ident, (&'a Item, &'a FieldsNamed)>, item_fields: IndexMap<Ident, (&'a Item, &'a FieldsNamed)>,
} }
impl<'a> GetterList<'a> { impl<'a> GetterList<'a> {

Loading…
Cancel
Save