Showing 3 of 3 files from the diff.
@@ -29,7 +29,6 @@
Loading
29 | 29 | public let correctLevel: QRErrorCorrectLevel |
|
30 | 30 | /// If the image codes has a border around its content. |
|
31 | 31 | public let hasBorder: Bool |
|
32 | - | private let typeNumber: Int |
|
33 | 32 | private let model: QRCodeModel |
|
34 | 33 | ||
35 | 34 | /// Construct a QRCode instance. |
@@ -48,8 +47,7 @@
Loading
48 | 47 | ||
49 | 48 | guard let model = QRCodeModel(text: text, encoding: encoding, errorCorrectLevel: errorCorrectLevel) |
|
50 | 49 | else { return nil } |
|
51 | - | // typeNumber = try? QRCodeType.typeNumber(of: text, errorCorrectLevel: errorCorrectLevel, encoding: encoding) |
|
52 | - | self.typeNumber = model.typeNumber |
|
50 | + | ||
53 | 51 | self.model = model |
|
54 | 52 | self.text = text |
|
55 | 53 | self.correctLevel = errorCorrectLevel |
@@ -68,7 +68,7 @@
Loading
68 | 68 | ||
69 | 69 | extension QRCodeType { |
|
70 | 70 | /// Get the type by string length |
|
71 | - | static func typeNumber(of text: String, errorCorrectLevel: QRErrorCorrectLevel, encoding: String.Encoding = .utf8) throws -> Int { |
|
71 | + | static func typeNumber(of text: String, encoding: String.Encoding = .utf8, errorCorrectLevel: QRErrorCorrectLevel) throws -> Int { |
|
72 | 72 | ||
73 | 73 | let textLength = text.lengthOfBytes(using: encoding) |
|
74 | 74 |
@@ -38,7 +38,7 @@
Loading
38 | 38 | ||
39 | 39 | self.encodedText = encoded |
|
40 | 40 | ||
41 | - | guard let newTypeNumber = try? QRCodeType.typeNumber(of: text, errorCorrectLevel: errorCorrectLevel, encoding: encoding) else { return nil } |
|
41 | + | guard let newTypeNumber = try? QRCodeType.typeNumber(of: text, encoding: encoding, errorCorrectLevel: errorCorrectLevel) else { return nil } |
|
42 | 42 | ||
43 | 43 | self.typeNumber = newTypeNumber |
|
44 | 44 | self.errorCorrectLevel = errorCorrectLevel |
Files | Coverage |
---|---|
Sources | 93.71% |
Project Totals (14 files) | 93.71% |
51.3
TRAVIS_OS_NAME=osx
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file.
The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files.
The size and color of each slice is representing the number of statements and the coverage, respectively.