Skip to content
This repository has been archived by the owner on Sep 6, 2018. It is now read-only.

Commit

Permalink
Remove redundant guard from FontConvertible.url
Browse files Browse the repository at this point in the history
  • Loading branch information
chipp committed Aug 22, 2017
1 parent 05e3b0d commit c32fb38
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ struct FontConvertible {

fileprivate var url: NSURL? {
let bundle = NSBundle(forClass: BundleToken.self)
guard let url = bundle.URLForResource(path, withExtension: nil) else { return nil }
return url
return bundle.URLForResource(path, withExtension: nil)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ struct FontConvertible {

fileprivate var url: NSURL? {
let bundle = NSBundle(forClass: BundleToken.self)
guard let url = bundle.URLForResource(path, withExtension: nil) else { return nil }
return url
return bundle.URLForResource(path, withExtension: nil)
}
}

Expand Down
3 changes: 1 addition & 2 deletions Tests/Expected/Fonts/swift2-context-defaults.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ struct FontConvertible {

fileprivate var url: NSURL? {
let bundle = NSBundle(forClass: BundleToken.self)
guard let url = bundle.URLForResource(path, withExtension: nil) else { return nil }
return url
return bundle.URLForResource(path, withExtension: nil)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ struct FontConvertible {

fileprivate var url: URL? {
let bundle = Bundle(for: BundleToken.self)
guard let url = bundle.url(forResource: path, withExtension: nil) else { return nil }
return url
return bundle.url(forResource: path, withExtension: nil)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ struct FontConvertible {

fileprivate var url: URL? {
let bundle = Bundle(for: BundleToken.self)
guard let url = bundle.url(forResource: path, withExtension: nil) else { return nil }
return url
return bundle.url(forResource: path, withExtension: nil)
}
}

Expand Down
3 changes: 1 addition & 2 deletions Tests/Expected/Fonts/swift3-context-defaults.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ struct FontConvertible {

fileprivate var url: URL? {
let bundle = Bundle(for: BundleToken.self)
guard let url = bundle.url(forResource: path, withExtension: nil) else { return nil }
return url
return bundle.url(forResource: path, withExtension: nil)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ struct FontConvertible {

fileprivate var url: URL? {
let bundle = Bundle(for: BundleToken.self)
guard let url = bundle.url(forResource: path, withExtension: nil) else { return nil }
return url
return bundle.url(forResource: path, withExtension: nil)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ struct FontConvertible {

fileprivate var url: URL? {
let bundle = Bundle(for: BundleToken.self)
guard let url = bundle.url(forResource: path, withExtension: nil) else { return nil }
return url
return bundle.url(forResource: path, withExtension: nil)
}
}

Expand Down
3 changes: 1 addition & 2 deletions Tests/Expected/Fonts/swift4-context-defaults.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ struct FontConvertible {

fileprivate var url: URL? {
let bundle = Bundle(for: BundleToken.self)
guard let url = bundle.url(forResource: path, withExtension: nil) else { return nil }
return url
return bundle.url(forResource: path, withExtension: nil)
}
}

Expand Down
3 changes: 1 addition & 2 deletions templates/fonts/swift2.stencil
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ struct FontConvertible {

fileprivate var url: NSURL? {
let bundle = NSBundle(forClass: BundleToken.self)
guard let url = bundle.URLForResource(path, withExtension: nil) else { return nil }
return url
return bundle.URLForResource(path, withExtension: nil)
}
}

Expand Down
3 changes: 1 addition & 2 deletions templates/fonts/swift3.stencil
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ struct FontConvertible {

fileprivate var url: URL? {
let bundle = Bundle(for: BundleToken.self)
guard let url = bundle.url(forResource: path, withExtension: nil) else { return nil }
return url
return bundle.url(forResource: path, withExtension: nil)
}
}

Expand Down
3 changes: 1 addition & 2 deletions templates/fonts/swift4.stencil
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ struct FontConvertible {

fileprivate var url: URL? {
let bundle = Bundle(for: BundleToken.self)
guard let url = bundle.url(forResource: path, withExtension: nil) else { return nil }
return url
return bundle.url(forResource: path, withExtension: nil)
}
}

Expand Down

0 comments on commit c32fb38

Please sign in to comment.