From 5779a0d499ab806cf379a952b7a03686da5e451c Mon Sep 17 00:00:00 2001 From: John DiSanti Date: Thu, 21 Jul 2022 14:06:56 -0700 Subject: [PATCH] Sort inline dependencies alphabetically by key --- .../smithy/rust/codegen/smithy/CodegenDelegator.kt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/CodegenDelegator.kt b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/CodegenDelegator.kt index 65501c648e..b981ad8e37 100644 --- a/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/CodegenDelegator.kt +++ b/codegen/src/main/kotlin/software/amazon/smithy/rust/codegen/smithy/CodegenDelegator.kt @@ -117,12 +117,14 @@ open class RustCrate( .filter { !writtenDependencies.contains(it.key()) } } while (unloadedDependencies().isNotEmpty()) { - unloadedDependencies().forEach { dep -> - writtenDependencies.add(dep.key()) - this.withModule(dep.module) { - dep.renderer(it) + unloadedDependencies() + .sortedBy { it.key() } + .forEach { dep -> + writtenDependencies.add(dep.key()) + this.withModule(dep.module) { + dep.renderer(it) + } } - } } }