Skip to content

Commit 8a033dc

Browse files
bmwiedemannsdroege
authored andcommitted
Use BTreeMap instead of HashMap
to have deterministic output ordering to allow for reproducible builds. See https://reproducible-builds.org/ for why this is good. Without this patch, ArchLinux' and openSUSE's identity package varied between builds.
1 parent 80bd385 commit 8a033dc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

glib-macros/src/properties.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use proc_macro::TokenStream;
55
use proc_macro2::TokenStream as TokenStream2;
66
use quote::format_ident;
77
use quote::{quote, quote_spanned};
8-
use std::collections::HashMap;
8+
use std::collections::BTreeMap;
99
use syn::ext::IdentExt;
1010
use syn::parenthesized;
1111
use syn::parse::Parse;
@@ -216,7 +216,7 @@ struct ReceivedAttrs {
216216
member: Option<syn::Ident>,
217217
name: Option<syn::LitStr>,
218218
builder: Option<(Punctuated<syn::Expr, Token![,]>, TokenStream2)>,
219-
builder_fields: HashMap<syn::Ident, Option<syn::Expr>>,
219+
builder_fields: BTreeMap<syn::Ident, Option<syn::Expr>>,
220220
use_default: bool,
221221
}
222222

@@ -271,7 +271,7 @@ struct PropDesc {
271271
set: Option<MaybeCustomFn>,
272272
member: Option<syn::Ident>,
273273
builder: Option<(Punctuated<syn::Expr, Token![,]>, TokenStream2)>,
274-
builder_fields: HashMap<syn::Ident, Option<syn::Expr>>,
274+
builder_fields: BTreeMap<syn::Ident, Option<syn::Expr>>,
275275
is_construct_only: bool,
276276
use_default: bool,
277277
}

0 commit comments

Comments
 (0)