@@ -59,15 +59,15 @@ struct Options {
59
59
var inputs = [ String] ( )
60
60
}
61
61
62
- enum OptionParseError : ErrorType {
62
+ enum OptionParseError : ErrorProtocol {
63
63
case UnrecognizedArgument( String )
64
64
case MissingArgument( String )
65
65
case InvalidFormat( String )
66
66
}
67
67
68
68
func parseArguments( _ args: [ String ] ) throws -> Options {
69
69
var opts = Options ( )
70
- var iterator = args. generate ( )
70
+ var iterator = args. makeIterator ( )
71
71
while let arg = iterator. next ( ) {
72
72
switch arg {
73
73
case " -- " :
@@ -201,7 +201,7 @@ enum DisplayType {
201
201
202
202
extension Dictionary {
203
203
func display( _ indent: Int = 0 , type: DisplayType = . Primary) {
204
- let indentation = String ( count : indent * 2 , repeatedValue : Character ( " " ) )
204
+ let indentation = String ( repeating : Character ( " " ) , count : indent * 2 )
205
205
if type == . Primary || type == . Key {
206
206
print ( " \( indentation) [ \n " , terminator: " " )
207
207
} else {
@@ -224,7 +224,7 @@ extension Dictionary {
224
224
225
225
extension Array {
226
226
func display( _ indent: Int = 0 , type: DisplayType = . Primary) {
227
- let indentation = String ( count : indent * 2 , repeatedValue : Character ( " " ) )
227
+ let indentation = String ( repeating : Character ( " " ) , count : indent * 2 )
228
228
if type == . Primary || type == . Key {
229
229
print ( " \( indentation) [ \n " , terminator: " " )
230
230
} else {
@@ -242,7 +242,7 @@ extension Array {
242
242
243
243
extension String {
244
244
func display( _ indent: Int = 0 , type: DisplayType = . Primary) {
245
- let indentation = String ( count : indent * 2 , repeatedValue : Character ( " " ) )
245
+ let indentation = String ( repeating : Character ( " " ) , count : indent * 2 )
246
246
if type == . Primary {
247
247
print ( " \( indentation) \" \( self ) \" \n " , terminator: " " )
248
248
}
@@ -256,7 +256,7 @@ extension String {
256
256
257
257
extension Bool {
258
258
func display( _ indent: Int = 0 , type: DisplayType = . Primary) {
259
- let indentation = String ( count : indent * 2 , repeatedValue : Character ( " " ) )
259
+ let indentation = String ( repeating : Character ( " " ) , count : indent * 2 )
260
260
if type == . Primary {
261
261
print ( " \( indentation) \" \( self ? " 1 " : " 0 " ) \" \n " , terminator: " " )
262
262
}
@@ -270,7 +270,7 @@ extension Bool {
270
270
271
271
extension NSNumber {
272
272
func display( _ indent: Int = 0 , type: DisplayType = . Primary) {
273
- let indentation = String ( count : indent * 2 , repeatedValue : Character ( " " ) )
273
+ let indentation = String ( repeating : Character ( " " ) , count : indent * 2 )
274
274
if type == . Primary {
275
275
print ( " \( indentation) \" \( self ) \" \n " , terminator: " " )
276
276
}
@@ -284,7 +284,7 @@ extension NSNumber {
284
284
285
285
extension NSData {
286
286
func display( _ indent: Int = 0 , type: DisplayType = . Primary) {
287
- let indentation = String ( count : indent * 2 , repeatedValue : Character ( " " ) )
287
+ let indentation = String ( repeating : Character ( " " ) , count : indent * 2 )
288
288
if type == . Primary {
289
289
print ( " \( indentation) \" \( self ) \" \n " , terminator: " " )
290
290
}
0 commit comments