Skip to content

Commit c92e4b6

Browse files
author
Fahad Zubair
committed
Wordings for some of the checks changed
1 parent aeb3b36 commit c92e4b6

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/Constraints.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ fun Shape.overriddenConstrainedMemberInfo(): Pair<Shape, MemberShape>? {
186186
* Returns the parent and the inline module that this particular shape should go in.
187187
*/
188188
fun Shape.getParentAndInlineModuleForConstrainedMember(symbolProvider: SymbolProvider, pubCrateServerBuilder: Boolean): Pair<RustModule.LeafModule, RustModule.LeafModule>? {
189-
//val container = overriddenConstrainedMemberInfo()?.first ?: return null
190189
val overriddenTrait = getTrait<SyntheticStructureFromConstrainedMemberTrait>() ?: return null
191190
return if (overriddenTrait.container is StructureShape) {
192191
val structureModule = symbolProvider.toSymbol(overriddenTrait.container).module()
@@ -201,7 +200,7 @@ fun Shape.getParentAndInlineModuleForConstrainedMember(symbolProvider: SymbolPro
201200
val shapeSymbol = symbolProvider.toSymbol(this)
202201
val shapeModule = shapeSymbol.module()
203202
check(!shapeModule.parent.isInline()) {
204-
"parent module of $id should not be an inline module"
203+
"Parent module of $id should not be an inline module"
205204
}
206205
Pair(shapeModule.parent as RustModule.LeafModule, shapeModule)
207206
}

codegen-server/src/main/kotlin/software/amazon/smithy/rust/codegen/server/smithy/RustCrateInlineModuleComposingWriter.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ fun RustCrate.withModuleOrWithStructureBuilderModule(
6767

6868
/**
6969
* If the passed in `shape` is a synthetic extracted shape resulting from a constrained struct member,
70-
* the `Writable` is called using the structure's builder module. Otherwise the `Writable` is called
70+
* the `Writable` is called using the structure's builder module. Otherwise, the `Writable` is called
7171
* using shape's `module`.
7272
*/
7373
fun RustCrate.useShapeWriterOrUseWithStructureBuilder(
@@ -104,7 +104,7 @@ fun RustCrate.withInMemoryInlineModule(
104104
codeWritable: Writable,
105105
) {
106106
check(inlineModule.isInline()) {
107-
"module has to be an inline module for it to be used with the InlineModuleWriter"
107+
"Module has to be an inline module for it to be used with the InlineModuleWriter"
108108
}
109109
this.getInlineModuleWriter().withInlineModuleHierarchy(outerWriter, inlineModule, docWriter) {
110110
codeWritable(this)
@@ -155,7 +155,7 @@ class InnerModule(debugMode : Boolean) {
155155
fun withInlineModuleHierarchyUsingCrate(rustCrate: RustCrate, inlineModule: RustModule.LeafModule, docWriter: DocWriter? = null, writable: Writable) {
156156
val hierarchy = getHierarchy(inlineModule).toMutableList()
157157
check(!hierarchy.first().isInline()) {
158-
"when adding a `RustModule.LeafModule` to the crate, the topmost module in the hierarchy cannot be an inline module"
158+
"When adding a `RustModule.LeafModule` to the crate, the topmost module in the hierarchy cannot be an inline module."
159159
}
160160
// The last in the hierarchy is the one we will return the writer for.
161161
val bottomMost = hierarchy.removeLast()
@@ -178,7 +178,7 @@ class InnerModule(debugMode : Boolean) {
178178
}
179179
} else {
180180
check(!bottomMost.isInline()) {
181-
"there is only one module in hierarchy so it has to be non-inlined"
181+
"There is only one module in the hierarchy, so it has to be non-inlined."
182182
}
183183
rustCrate.withModule(bottomMost) {
184184
registerTopMostWriter(this)
@@ -197,7 +197,7 @@ class InnerModule(debugMode : Boolean) {
197197
hierarchy.removeFirst()
198198
}
199199
check(hierarchy.isNotEmpty()) {
200-
"an inline module should always have one parent besides itself"
200+
"An inline module should always have one parent besides itself."
201201
}
202202

203203
// The last in the hierarchy is the module under which the new inline module resides.

0 commit comments

Comments
 (0)