Skip to content

Commit 16fa18c

Browse files
committed
Disambiguated return values
1 parent fa20ab6 commit 16fa18c

File tree

3 files changed

+19
-17
lines changed

3 files changed

+19
-17
lines changed

Sources/Turf/GeoJSON.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@ public protocol GeoJSONObjectConvertible {
7575
}
7676

7777
extension Geometry: GeoJSONObjectConvertible {
78-
public var geoJSONObject: GeoJSONObject { .geometry(self) }
78+
public var geoJSONObject: GeoJSONObject { return .geometry(self) }
7979
}
8080

8181
extension Feature: GeoJSONObjectConvertible {
82-
public var geoJSONObject: GeoJSONObject { .feature(self) }
82+
public var geoJSONObject: GeoJSONObject { return .feature(self) }
8383
}
8484

8585
extension FeatureCollection: GeoJSONObjectConvertible {
86-
public var geoJSONObject: GeoJSONObject { .featureCollection(self) }
86+
public var geoJSONObject: GeoJSONObject { return .featureCollection(self) }
8787
}

Sources/Turf/Geometry.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,33 +100,33 @@ public protocol GeometryConvertible {
100100
}
101101

102102
extension Geometry: GeometryConvertible {
103-
public var geometry: Geometry { self }
103+
public var geometry: Geometry { return self }
104104
}
105105

106106
extension Point: GeometryConvertible {
107-
public var geometry: Geometry { .point(self) }
107+
public var geometry: Geometry { return .point(self) }
108108
}
109109

110110
extension LineString: GeometryConvertible {
111-
public var geometry: Geometry { .lineString(self) }
111+
public var geometry: Geometry { return .lineString(self) }
112112
}
113113

114114
extension Polygon: GeometryConvertible {
115-
public var geometry: Geometry { .polygon(self) }
115+
public var geometry: Geometry { return .polygon(self) }
116116
}
117117

118118
extension MultiPoint: GeometryConvertible {
119-
public var geometry: Geometry { .multiPoint(self) }
119+
public var geometry: Geometry { return .multiPoint(self) }
120120
}
121121

122122
extension MultiLineString: GeometryConvertible {
123-
public var geometry: Geometry { .multiLineString(self) }
123+
public var geometry: Geometry { return .multiLineString(self) }
124124
}
125125

126126
extension MultiPolygon: GeometryConvertible {
127-
public var geometry: Geometry { .multiPolygon(self) }
127+
public var geometry: Geometry { return .multiPolygon(self) }
128128
}
129129

130130
extension GeometryCollection: GeometryConvertible {
131-
public var geometry: Geometry { .geometryCollection(self) }
131+
public var geometry: Geometry { return .geometryCollection(self) }
132132
}

Sources/Turf/JSON.swift

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -227,27 +227,29 @@ public protocol JSONValueConvertible {
227227
}
228228

229229
extension String: JSONValueConvertible {
230-
public var jsonValue: JSONValue { .string(self) }
230+
public var jsonValue: JSONValue { return .string(self) }
231231
}
232232

233233
extension Int: JSONValueConvertible {
234-
public var jsonValue: JSONValue { .number(Double(self)) }
234+
public var jsonValue: JSONValue { return .number(Double(self)) }
235235
}
236236

237237
extension Double: JSONValueConvertible {
238-
public var jsonValue: JSONValue { .number(Double(self)) }
238+
public var jsonValue: JSONValue { return .number(Double(self)) }
239239
}
240240

241241
extension Bool: JSONValueConvertible {
242-
public var jsonValue: JSONValue { .boolean(self) }
242+
public var jsonValue: JSONValue { return .boolean(self) }
243243
}
244244

245245
extension Array: JSONValueConvertible where Element == JSONValueConvertible? {
246-
public var jsonValue: JSONValue { .array(map { $0?.jsonValue }) }
246+
public var jsonValue: JSONValue {
247+
return .array(map { $0?.jsonValue })
248+
}
247249
}
248250

249251
extension Dictionary: JSONValueConvertible where Key == String, Value == JSONValueConvertible? {
250252
public var jsonValue: JSONValue {
251-
.object(.init(uniqueKeysWithValues: map { ($0.0, $0.1?.jsonValue) }))
253+
return .object(JSONObject(uniqueKeysWithValues: map { ($0.0, $0.1?.jsonValue) }))
252254
}
253255
}

0 commit comments

Comments
 (0)