Skip to content

Commit cae14e9

Browse files
committed
prefer let for variable that does not need to be mutated.
1 parent 93efa69 commit cae14e9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Sources/JSONAPI/Resource/Relationship.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,9 +402,11 @@ extension ToManyRelationship: Codable {
402402
}
403403

404404
let hasData = container.contains(.data)
405-
var canHaveNoDataInRelationships: Bool = false
405+
let canHaveNoDataInRelationships: Bool
406406
if let relatableType = Relatable.self as? ResourceObjectWithOptionalDataInRelationships.Type {
407407
canHaveNoDataInRelationships = relatableType.canHaveNoDataInRelationships
408+
} else {
409+
canHaveNoDataInRelationships = false
408410
}
409411
guard hasData || !canHaveNoDataInRelationships else {
410412
idsWithMeta = []

0 commit comments

Comments
 (0)