From 5d0aa1193fc85b56c9b6eb572922d683f0dd7c48 Mon Sep 17 00:00:00 2001 From: Lucien Greathouse Date: Mon, 14 Oct 2019 17:29:34 -0700 Subject: [PATCH] Fix LocalizationTable output order by switching to a BTreeMap. ACTUALLY closes #173. --- CHANGELOG.md | 1 + server/src/rbx_snapshot.rs | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 092bf0f7d..18740560b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Rojo Changelog ## Unreleased Changes +* Fixed an issue where `LocalizationTable` instances would have their column order randomized. ([#173](https://github.com/rojo-rbx/rojo/issues/173)) ## [0.5.1](https://github.com/rojo-rbx/rojo/releases/tag/v0.5.1) (October 4, 2019) * Fixed an issue where Rojo would drop changes if they happened too quickly ([#252](https://github.com/rojo-rbx/rojo/issues/252)) diff --git a/server/src/rbx_snapshot.rs b/server/src/rbx_snapshot.rs index 8ed65ea74..ca8f76d79 100644 --- a/server/src/rbx_snapshot.rs +++ b/server/src/rbx_snapshot.rs @@ -3,7 +3,7 @@ use std::{ borrow::Cow, - collections::HashMap, + collections::{BTreeMap, HashMap}, fmt, path::{Path, PathBuf}, str, @@ -631,7 +631,8 @@ fn snapshot_csv_file<'source>( #[serde(skip_serializing_if = "Option::is_none")] source: Option<&'a str>, - values: HashMap<&'a str, &'a str>, + // We use a BTreeMap here to get deterministic output order. + values: BTreeMap<&'a str, &'a str>, } let instance_name = file.path