Skip to content

Commit

Permalink
Remove mutating from function that doesn't mutate anything (#1110)
Browse files Browse the repository at this point in the history
  • Loading branch information
d-ronnqvist authored Dec 3, 2024
1 parent 9b8db28 commit 7a34828
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ extension AsyncAction {
/// - Parameter logHandle: The log handle to write encountered warnings and errors to.
///
/// - Throws: `ErrorsEncountered` if any errors are produced while performing the action.
public mutating func performAndHandleResult(logHandle: LogHandle = .standardOutput) async throws {
public func performAndHandleResult(logHandle: LogHandle = .standardOutput) async throws {
var logHandle = logHandle
// Perform the Action and collect the result
let result = try await perform(logHandle: &logHandle)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ extension Docc {
}

public func run() async throws {
var convertAction = try ConvertAction(fromConvertCommand: self)
let convertAction = try ConvertAction(fromConvertCommand: self)
try await convertAction.performAndHandleResult()
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ extension Docc.ProcessCatalog {
}

func run() async throws {
var action = try EmitGeneratedCurationAction(fromCommand: self)
let action = try EmitGeneratedCurationAction(fromCommand: self)
try await action.performAndHandleResult()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ extension Docc {
}

public func run() async throws {
var indexAction = try IndexAction(fromIndexCommand: self)
let indexAction = try IndexAction(fromIndexCommand: self)
try await indexAction.performAndHandleResult()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ extension Docc {
public var initOptions: InitOptions

public func run() async throws {
var initAction = try InitAction(fromInitOptions: initOptions)
let initAction = try InitAction(fromInitOptions: initOptions)
try await initAction.performAndHandleResult()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ extension Docc {

public func run() async throws {
// Initialize a `ConvertAction` from the current options in the `Convert` command.
var convertAction = MergeAction(
let convertAction = MergeAction(
archives: archives,
landingPageInfo: .synthesize(.init(name: synthesizedLandingPageName, kind: synthesizedLandingPageKind, style: synthesizedLandingPageTopicsStyle)),
outputURL: outputURL,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ extension Docc {
}

public func run() async throws {
var previewAction = try PreviewAction(fromPreviewOptions: previewOptions)
let previewAction = try PreviewAction(fromPreviewOptions: previewOptions)
try await previewAction.performAndHandleResult()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ extension Docc.ProcessArchive {
}

func run() async throws {
var action = try TransformForStaticHostingAction(fromCommand: self)
let action = try TransformForStaticHostingAction(fromCommand: self)
try await action.performAndHandleResult()
}
}
Expand Down

0 comments on commit 7a34828

Please sign in to comment.