Skip to content

Commit

Permalink
Wordings for some of the checks changed
Browse files Browse the repository at this point in the history
  • Loading branch information
Fahad Zubair committed Feb 16, 2023
1 parent aeb3b36 commit c92e4b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ fun Shape.overriddenConstrainedMemberInfo(): Pair<Shape, MemberShape>? {
* Returns the parent and the inline module that this particular shape should go in.
*/
fun Shape.getParentAndInlineModuleForConstrainedMember(symbolProvider: SymbolProvider, pubCrateServerBuilder: Boolean): Pair<RustModule.LeafModule, RustModule.LeafModule>? {
//val container = overriddenConstrainedMemberInfo()?.first ?: return null
val overriddenTrait = getTrait<SyntheticStructureFromConstrainedMemberTrait>() ?: return null
return if (overriddenTrait.container is StructureShape) {
val structureModule = symbolProvider.toSymbol(overriddenTrait.container).module()
Expand All @@ -201,7 +200,7 @@ fun Shape.getParentAndInlineModuleForConstrainedMember(symbolProvider: SymbolPro
val shapeSymbol = symbolProvider.toSymbol(this)
val shapeModule = shapeSymbol.module()
check(!shapeModule.parent.isInline()) {
"parent module of $id should not be an inline module"
"Parent module of $id should not be an inline module"
}
Pair(shapeModule.parent as RustModule.LeafModule, shapeModule)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ fun RustCrate.withModuleOrWithStructureBuilderModule(

/**
* If the passed in `shape` is a synthetic extracted shape resulting from a constrained struct member,
* the `Writable` is called using the structure's builder module. Otherwise the `Writable` is called
* the `Writable` is called using the structure's builder module. Otherwise, the `Writable` is called
* using shape's `module`.
*/
fun RustCrate.useShapeWriterOrUseWithStructureBuilder(
Expand Down Expand Up @@ -104,7 +104,7 @@ fun RustCrate.withInMemoryInlineModule(
codeWritable: Writable,
) {
check(inlineModule.isInline()) {
"module has to be an inline module for it to be used with the InlineModuleWriter"
"Module has to be an inline module for it to be used with the InlineModuleWriter"
}
this.getInlineModuleWriter().withInlineModuleHierarchy(outerWriter, inlineModule, docWriter) {
codeWritable(this)
Expand Down Expand Up @@ -155,7 +155,7 @@ class InnerModule(debugMode : Boolean) {
fun withInlineModuleHierarchyUsingCrate(rustCrate: RustCrate, inlineModule: RustModule.LeafModule, docWriter: DocWriter? = null, writable: Writable) {
val hierarchy = getHierarchy(inlineModule).toMutableList()
check(!hierarchy.first().isInline()) {
"when adding a `RustModule.LeafModule` to the crate, the topmost module in the hierarchy cannot be an inline module"
"When adding a `RustModule.LeafModule` to the crate, the topmost module in the hierarchy cannot be an inline module."
}
// The last in the hierarchy is the one we will return the writer for.
val bottomMost = hierarchy.removeLast()
Expand All @@ -178,7 +178,7 @@ class InnerModule(debugMode : Boolean) {
}
} else {
check(!bottomMost.isInline()) {
"there is only one module in hierarchy so it has to be non-inlined"
"There is only one module in the hierarchy, so it has to be non-inlined."
}
rustCrate.withModule(bottomMost) {
registerTopMostWriter(this)
Expand All @@ -197,7 +197,7 @@ class InnerModule(debugMode : Boolean) {
hierarchy.removeFirst()
}
check(hierarchy.isNotEmpty()) {
"an inline module should always have one parent besides itself"
"An inline module should always have one parent besides itself."
}

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

0 comments on commit c92e4b6

Please sign in to comment.