chore(linter/swift): add shorthand_optional_binding rule (#3456)

* chore(linter/swift): add `shorthand_optional_binding` rule

* lint code
This commit is contained in:
Krzysztof Moch
2024-01-04 20:16:23 +01:00
committed by GitHub
parent 481cc71eda
commit 2ed3949307
10 changed files with 56 additions and 55 deletions

View File

@@ -30,7 +30,7 @@ class RCTVideoCachingHandler: NSObject, DVAssetLoaderDelegatesDelegate {
let url = URL(string: uri)
return getItemForUri(uri)
.then { [weak self] (videoCacheStatus: RCTVideoCacheStatus, cachedAsset: AVAsset?) -> AVPlayerItem in
guard let self = self, let playerItemPrepareText = self.playerItemPrepareText else { throw NSError(domain: "", code: 0, userInfo: nil) }
guard let self, let playerItemPrepareText = self.playerItemPrepareText else { throw NSError(domain: "", code: 0, userInfo: nil) }
switch videoCacheStatus {
case .missingFileExtension:
DebugLog("""
@@ -53,7 +53,7 @@ class RCTVideoCachingHandler: NSObject, DVAssetLoaderDelegatesDelegate {
return playerItemPrepareText(asset, options, "")
default:
if let cachedAsset = cachedAsset {
if let cachedAsset {
DebugLog("Playing back uri '\(uri)' from cache")
// See note in playerItemForSource about not being able to support text tracks & caching
return AVPlayerItem(asset: cachedAsset)