Make sure that imports are always in the same order between runs. This
makes the output more stable for putting it into a versioning system like git
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
use anyhow::Result;
|
||||
use log::warn;
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use std::collections::{BTreeMap, BTreeSet};
|
||||
|
||||
use crate::compile::{Compile, CompileContext, FileGenerator};
|
||||
use crate::ir::{BaseType, EnumDefinition, ServiceDefinition, Step, Type, TypeDefinition};
|
||||
@ -46,7 +46,7 @@ impl RustCompiler {
|
||||
fn add_dependencies(
|
||||
&mut self,
|
||||
file: &mut FileGenerator,
|
||||
depends: &HashSet<BaseType>,
|
||||
depends: &BTreeSet<BaseType>,
|
||||
) -> Result<()> {
|
||||
for dep in depends {
|
||||
match dep {
|
||||
@ -409,7 +409,7 @@ impl RustCompiler {
|
||||
}
|
||||
|
||||
impl Compile for RustCompiler {
|
||||
fn new(options: &HashMap<String, String>) -> anyhow::Result<Self> {
|
||||
fn new(options: &BTreeMap<String, String>) -> anyhow::Result<Self> {
|
||||
let crate_name = if let Some(crate_name) = options.get("rust_crate") {
|
||||
crate_name.to_string()
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user