Skip to content

Commit

Permalink
Remove mutating from processors
Browse files Browse the repository at this point in the history
  • Loading branch information
fwcd committed Apr 29, 2024
1 parent a84c084 commit 7e288f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Sources/MusicLibrary/Process/CopyProcessor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public struct CopyProcessor: LibraryProcessor {
self.mapping = mapping
}

public mutating func process(library: inout Library, onProgress: (ProgressInfo) -> Void) throws {
public func process(library: inout Library, onProgress: (ProgressInfo) -> Void) throws {
var progress = ProgressInfo(total: library.tracks.count) {
didSet { onProgress(progress) }
}
Expand Down
4 changes: 2 additions & 2 deletions Sources/MusicLibrary/Process/LibraryProcessor.swift
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/// A processing stage that transforms a library
public protocol LibraryProcessor {
/// Processes the library.
mutating func process(library: inout Library, onProgress: (ProgressInfo) -> Void) throws
func process(library: inout Library, onProgress: (ProgressInfo) -> Void) throws
}

public extension LibraryProcessor {
mutating func process(library: inout Library) throws {
func process(library: inout Library) throws {
try process(library: &library, onProgress: { _ in })
}
}
Expand Down

0 comments on commit 7e288f9

Please sign in to comment.