Skip to content

Commit

Permalink
Fix SwiftLint violations
Browse files Browse the repository at this point in the history
mattrubin committed Aug 18, 2024

Verified

This commit was signed with the committer’s verified signature. The key has expired.
tvdeyen Thomas von Deyen
1 parent 7d99656 commit 42964a4
Showing 3 changed files with 3 additions and 9 deletions.
6 changes: 0 additions & 6 deletions Sources/PersistentToken.swift
Original file line number Diff line number Diff line change
@@ -34,12 +34,6 @@ public struct PersistentToken: Equatable, Hashable {
/// The keychain's persistent identifier for the saved token.
public let identifier: Data

/// Initializes a new `PersistentToken` with the given properties.
internal init(token: Token, identifier: Data) {
self.token = token
self.identifier = identifier
}

/// Hashes the persistent token's identifier into the given hasher, providing `Hashable` conformance.
public func hash(into hasher: inout Hasher) {
// Since we expect every `PersistentToken`s identifier to be unique, the identifier's hash
2 changes: 1 addition & 1 deletion Tests/EquatableTests.swift
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@ class EquatableTests: XCTestCase {

func testGeneratorEquality() throws {
let generator = try Generator(factor: .counter(0), secret: Data(), algorithm: .sha1, digits: 6)
let badData = "0".data(using: String.Encoding.utf8)!
let badData = Data("0".utf8)

XCTAssert(try generator == Generator(factor: .counter(0), secret: Data(), algorithm: .sha1, digits: 6))
XCTAssert(try generator != Generator(factor: .counter(1), secret: Data(), algorithm: .sha1, digits: 6))
4 changes: 2 additions & 2 deletions Tests/KeychainTests.swift
Original file line number Diff line number Diff line change
@@ -257,7 +257,7 @@ class KeychainTests: XCTestCase {
}

func testBadData() throws {
let badData = " ".data(using: .utf8)!
let badData = Data(" ".utf8)

let keychainAttributes: [String: AnyObject] = [
kSecAttrGeneric as String: badData as NSData,
@@ -275,7 +275,7 @@ class KeychainTests: XCTestCase {
}

func testBadURL() throws {
let badData = "http://example.com".data(using: .utf8)!
let badData = Data("http://example.com".utf8)

let keychainAttributes: [String: AnyObject] = [
kSecAttrGeneric as String: badData as NSData,

0 comments on commit 42964a4

Please sign in to comment.