Skip to content

Commit

Permalink
Sendable Conformance (#7)
Browse files Browse the repository at this point in the history
* Declare Sendable conformances for models

* Sendable conformance for DiskCache
  • Loading branch information
mgacy committed Jul 3, 2024
1 parent 2271214 commit 1624e93
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Sources/DiskCache/Cache.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import Foundation

/// A class of types providing interfaces for caching and retrieving data to/from disk.
public protocol Cache {
public protocol Cache: Sendable {

/// Synchronously writes `data` to disk.
/// - Parameters:
Expand Down
2 changes: 1 addition & 1 deletion Sources/DiskCache/DiskCache.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Foundation
typealias VoidUnsafeContinuation = UnsafeContinuation<Void, Error>

/// Provides interfaces for caching and retrieving data to/from disk.
public class DiskCache: Cache {
public final class DiskCache: Cache {
let storageType: StorageType

/// Intializes a new instance of `DiskCache`. The path to the cache is created if not already presents. Throws if path cannot be created for some reason.
Expand Down
2 changes: 1 addition & 1 deletion Sources/DiskCache/StorageType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Foundation
public typealias AppGroupID = String

/// A location where data may be stored.
public enum StorageType {
public enum StorageType: Sendable {
/// Stores data in user's `caches` directory, which is volatile.
case temporary(_ subDirectory: SubDirectory? = nil)
/// Stores data in user's `directory` directory.
Expand Down
2 changes: 1 addition & 1 deletion Sources/DiskCache/SubDirectory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import Foundation

/// A subdirectory of a ``StorageType`` where data is stored.
public enum SubDirectory {
public enum SubDirectory: Sendable {
/// An `images` subdirectory.
case images
/// A subdirectory with a custom name.
Expand Down

0 comments on commit 1624e93

Please sign in to comment.