Skip to content

Commit d087b50

Browse files
committed
Re-style
1 parent 6d441c3 commit d087b50

File tree

2 files changed

+16
-19
lines changed

2 files changed

+16
-19
lines changed

Sources/SparkConnect/Row.swift

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import Foundation
2020

2121
public struct Row: Sendable, Equatable {
22-
let values : [Sendable?]
22+
let values: [Sendable?]
2323

2424
public init(_ values: Sendable?...) {
2525
self.values = values
@@ -30,14 +30,12 @@ public struct Row: Sendable, Equatable {
3030
}
3131

3232
public static var empty: Row {
33-
get {
34-
return Row()
35-
}
33+
return Row()
3634
}
3735

38-
public var size: Int { get { return length } }
36+
public var size: Int { return length }
3937

40-
public var length: Int { get { return values.count } }
38+
public var length: Int { return values.count }
4139

4240
subscript(index: Int) -> Sendable {
4341
get throws {
@@ -46,21 +44,21 @@ public struct Row: Sendable, Equatable {
4644
}
4745

4846
public func get(_ i: Int) throws -> Sendable {
49-
if (i < 0 || i >= self.length) {
47+
if i < 0 || i >= self.length {
5048
throw SparkConnectError.InvalidArgumentException
5149
}
5250
return values[i]
5351
}
5452

5553
public static func == (lhs: Row, rhs: Row) -> Bool {
56-
if (lhs.values.count != rhs.values.count) {
54+
if lhs.values.count != rhs.values.count {
5755
return false
5856
}
5957
return lhs.values.elementsEqual(rhs.values) { (x, y) in
6058
if x == nil && y == nil {
6159
return true
6260
} else if let a = x as? Bool, let b = y as? Bool {
63-
return a == b
61+
return a == b
6462
} else if let a = x as? Int, let b = y as? Int {
6563
return a == b
6664
} else if let a = x as? Int8, let b = y as? Int8 {
@@ -72,11 +70,11 @@ public struct Row: Sendable, Equatable {
7270
} else if let a = x as? Int64, let b = y as? Int64 {
7371
return a == b
7472
} else if let a = x as? Float, let b = y as? Float {
75-
return a == b
73+
return a == b
7674
} else if let a = x as? Double, let b = y as? Double {
77-
return a == b
75+
return a == b
7876
} else if let a = x as? String, let b = y as? String {
79-
return a == b
77+
return a == b
8078
} else {
8179
return false
8280
}

Tests/SparkConnectTests/RowTests.swift

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@
1818
//
1919

2020
import Foundation
21-
import Testing
22-
2321
import SparkConnect
22+
import Testing
2423

2524
/// A test suite for `Row`
2625
struct RowTests {
@@ -67,8 +66,8 @@ struct RowTests {
6766

6867
#expect(Row(1) == Row(1))
6968
#expect(Row(1) != Row(2))
70-
#expect(Row(1,2,3) == Row(1,2,3))
71-
#expect(Row(1,2,3) != Row(1,2,4))
69+
#expect(Row(1, 2, 3) == Row(1, 2, 3))
70+
#expect(Row(1, 2, 3) != Row(1, 2, 4))
7271

7372
#expect(Row(1.0) == Row(1.0))
7473
#expect(Row(1.0) != Row(2.0))
@@ -79,9 +78,9 @@ struct RowTests {
7978
#expect(Row(true) == Row(true))
8079
#expect(Row(true) != Row(false))
8180

82-
#expect(Row(1,"a") == Row(1,"a"))
83-
#expect(Row(1,"a") != Row(2,"a"))
84-
#expect(Row(1,"a") != Row(1,"b"))
81+
#expect(Row(1, "a") == Row(1, "a"))
82+
#expect(Row(1, "a") != Row(2, "a"))
83+
#expect(Row(1, "a") != Row(1, "b"))
8584

8685
#expect(Row(0, 1, 2) == Row(valueArray: [0, 1, 2]))
8786

0 commit comments

Comments
 (0)