Skip to content

Commit 7a34828

Browse files
authored
Remove mutating from function that doesn't mutate anything (#1110)
1 parent 9b8db28 commit 7a34828

File tree

8 files changed

+8
-8
lines changed

8 files changed

+8
-8
lines changed

Sources/SwiftDocCUtilities/ArgumentParsing/ActionExtensions/Action+performAndHandleResult.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ extension AsyncAction {
1717
/// - Parameter logHandle: The log handle to write encountered warnings and errors to.
1818
///
1919
/// - Throws: `ErrorsEncountered` if any errors are produced while performing the action.
20-
public mutating func performAndHandleResult(logHandle: LogHandle = .standardOutput) async throws {
20+
public func performAndHandleResult(logHandle: LogHandle = .standardOutput) async throws {
2121
var logHandle = logHandle
2222
// Perform the Action and collect the result
2323
let result = try await perform(logHandle: &logHandle)

Sources/SwiftDocCUtilities/ArgumentParsing/Subcommands/Convert.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ extension Docc {
674674
}
675675

676676
public func run() async throws {
677-
var convertAction = try ConvertAction(fromConvertCommand: self)
677+
let convertAction = try ConvertAction(fromConvertCommand: self)
678678
try await convertAction.performAndHandleResult()
679679
}
680680

Sources/SwiftDocCUtilities/ArgumentParsing/Subcommands/EmitGeneratedCuration.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ extension Docc.ProcessCatalog {
157157
}
158158

159159
func run() async throws {
160-
var action = try EmitGeneratedCurationAction(fromCommand: self)
160+
let action = try EmitGeneratedCurationAction(fromCommand: self)
161161
try await action.performAndHandleResult()
162162
}
163163
}

Sources/SwiftDocCUtilities/ArgumentParsing/Subcommands/Index.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ extension Docc {
3737
}
3838

3939
public func run() async throws {
40-
var indexAction = try IndexAction(fromIndexCommand: self)
40+
let indexAction = try IndexAction(fromIndexCommand: self)
4141
try await indexAction.performAndHandleResult()
4242
}
4343
}

Sources/SwiftDocCUtilities/ArgumentParsing/Subcommands/Init.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ extension Docc {
2525
public var initOptions: InitOptions
2626

2727
public func run() async throws {
28-
var initAction = try InitAction(fromInitOptions: initOptions)
28+
let initAction = try InitAction(fromInitOptions: initOptions)
2929
try await initAction.performAndHandleResult()
3030
}
3131
}

Sources/SwiftDocCUtilities/ArgumentParsing/Subcommands/Merge.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ extension Docc {
169169

170170
public func run() async throws {
171171
// Initialize a `ConvertAction` from the current options in the `Convert` command.
172-
var convertAction = MergeAction(
172+
let convertAction = MergeAction(
173173
archives: archives,
174174
landingPageInfo: .synthesize(.init(name: synthesizedLandingPageName, kind: synthesizedLandingPageKind, style: synthesizedLandingPageTopicsStyle)),
175175
outputURL: outputURL,

Sources/SwiftDocCUtilities/ArgumentParsing/Subcommands/Preview.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ extension Docc {
4444
}
4545

4646
public func run() async throws {
47-
var previewAction = try PreviewAction(fromPreviewOptions: previewOptions)
47+
let previewAction = try PreviewAction(fromPreviewOptions: previewOptions)
4848
try await previewAction.performAndHandleResult()
4949
}
5050
}

Sources/SwiftDocCUtilities/ArgumentParsing/Subcommands/TransformForStaticHosting.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ extension Docc.ProcessArchive {
6363
}
6464

6565
func run() async throws {
66-
var action = try TransformForStaticHostingAction(fromCommand: self)
66+
let action = try TransformForStaticHostingAction(fromCommand: self)
6767
try await action.performAndHandleResult()
6868
}
6969
}

0 commit comments

Comments
 (0)