File tree 1 file changed +4
-10
lines changed
Example/iOSDFULibrary/DFU Test Performer
1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,6 @@ import CoreBluetooth
34
34
35
35
enum DFUTestError : Error {
36
36
case fileNotFound
37
- case invalidFirmware
38
37
}
39
38
40
39
typealias AdvertisingData = [ String : Any ]
@@ -82,10 +81,9 @@ class FilterBy {
82
81
83
82
class Option {
84
83
85
- static let prn : ( UInt16 ) -> ServiceModifier = {
86
- aPRNValue in
84
+ static let prn : ( UInt16 ) -> ServiceModifier = { prn in
87
85
return {
88
- initiator in initiator. packetReceiptNotificationParameter = aPRNValue
86
+ initiator in initiator. packetReceiptNotificationParameter = prn
89
87
}
90
88
}
91
89
@@ -97,14 +95,10 @@ class Option {
97
95
extension DFUFirmware {
98
96
99
97
private static func from( urlToZipFile url: URL ? , type: DFUFirmwareType ) throws -> DFUFirmware {
100
- guard url != nil else {
98
+ guard let url = url else {
101
99
throw DFUTestError . fileNotFound
102
100
}
103
- let firmware = DFUFirmware ( urlToZipFile: url!, type: type)
104
- guard firmware != nil else {
105
- throw DFUTestError . invalidFirmware
106
- }
107
- return firmware!
101
+ return try DFUFirmware ( urlToZipFile: url, type: type)
108
102
}
109
103
110
104
static func from( zip name: String , locatedIn subdirectory: String ) throws -> DFUFirmware {
You can’t perform that action at this time.
0 commit comments