Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove mutating from function that doesn't mutate anything #1110

Merged
merged 2 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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