Skip to content

Commit 4322236

Browse files
feat: Removes CLI Swift 6 mutability warnings
1 parent ecea295 commit 4322236

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sources/CLI/Convert.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import ArgumentParser
22
import Units
33

44
struct Convert: ParsableCommand {
5-
static var configuration = CommandConfiguration(
5+
static let configuration = CommandConfiguration(
66
abstract: "Convert a measurement expression to a specified unit.",
77
discussion: """
88
Run `unit list` to see the supported unit symbols and names. Unless arguments are wrapped \
@@ -39,14 +39,14 @@ struct Convert: ParsableCommand {
3939
}
4040
}
4141

42-
extension Expression: ExpressibleByArgument {
42+
extension Expression: @retroactive ExpressibleByArgument {
4343
public convenience init?(argument: String) {
4444
let argument = argument.replacingOccurrences(of: "_", with: " ")
4545
try? self.init(argument)
4646
}
4747
}
4848

49-
extension Units.Unit: ExpressibleByArgument {
49+
extension Units.Unit: @retroactive ExpressibleByArgument {
5050
public init?(argument: String) {
5151
if let unit = try? Self(fromName: argument) {
5252
self = unit

Sources/CLI/List.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import ArgumentParser
22
import Units
33

44
struct List: ParsableCommand {
5-
static var configuration = CommandConfiguration(
5+
static let configuration = CommandConfiguration(
66
abstract: "Print a table of the available units, their symbols, and their dimensionality."
77
)
88

Sources/CLI/Unit.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import ArgumentParser
22

33
struct Unit: ParsableCommand {
4-
static var configuration = CommandConfiguration(
4+
static let configuration = CommandConfiguration(
55
abstract: "A utility for performing unit conversions.",
66
subcommands: [Convert.self, List.self]
77
)

0 commit comments

Comments
 (0)