Skip to content

Commit

Permalink
Safety-first data handling (#32)
Browse files Browse the repository at this point in the history
* Safety-first data handling

* Update Circle info
  • Loading branch information
stephencelis committed Oct 28, 2017
1 parent b4081b7 commit d9fdff4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Sources/SnapshotTesting/Diffable.swift
Expand Up @@ -48,11 +48,11 @@ extension String: Diffable {
}

public static func fromDiffableData(_ diffableData: Data) -> String {
return String(data: diffableData, encoding: .utf8)!
return String(decoding: diffableData, as: UTF8.self)
}

public var diffableData: Data {
return self.data(using: .utf8)!
return Data(self.utf8)
}

public var diffableDescription: String? {
Expand Down
2 changes: 1 addition & 1 deletion circle.yml
Expand Up @@ -7,5 +7,5 @@ test:
pre:
- swift package generate-xcodeproj
override:
- xcodebuild test -scheme SnapshotTesting-Package -destination platform="iOS Simulator,name=iPhone 7,OS=11.0"
- xcodebuild test -scheme SnapshotTesting-Package -destination platform="iOS Simulator,name=iPhone 8,OS=11.0.1"
- xcodebuild test -scheme SnapshotTesting-Package -destination platform="macOS"

0 comments on commit d9fdff4

Please sign in to comment.