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

@ -10,3 +10,4 @@ anyhow = "1"
syn = {version = "1", features = ["visit-mut", "extra-traits"] }
quote = "1"
proc-macro2 = "1"
indexmap = "1.6"

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

Loading…
Cancel
Save