Skip to content

Commit 0cdfdd1

Browse files
committed
Silence warnings from swiftlint
1 parent 54afeb4 commit 0cdfdd1

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

Sources/MathParser/Evaluator.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ struct EvalState {
141141
self.binaryFunctions?(String(name)) ?? MathParser.defaultBinaryFunctions.producer(String(name))
142142
}
143143

144+
// swiftlint:disable unneeded_synthesized_initializer
144145
@usableFromInline
145146
init(variables: MathParser.VariableMap?,
146147
unaryFunctions: MathParser.UnaryFunctionMap?,
@@ -151,4 +152,5 @@ struct EvalState {
151152
self.binaryFunctions = binaryFunctions
152153
self.usingImpliedMultiplication = usingImpliedMultiplication
153154
}
155+
// swiftlint:enable unneeded_synthesized_initializer
154156
}

Sources/MathParser/MathParser.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright © 2023 Brad Howes. All rights reserved.
1+
// Copyright © 2023, 2024 Brad Howes. All rights reserved.
22

33
import Parsing
44
import Foundation
@@ -85,7 +85,7 @@ final public class MathParser {
8585
public static let defaultUnaryFunctions: UnaryFunctionDict = [
8686
"sin": sin, "asin": asin, "cos": cos, "acos": acos, "tan": tan, "atan": atan,
8787
"sinh": sinh, "asinh": asinh, "cosh": cosh, "acosh": acosh, "tanh": tanh, "atanh": atanh,
88-
"log": log10, "log10": log10, "ln": log, "loge": log, "log2": log2, "exp": exp,
88+
"log": log10, "log10": log10, "ln": log, "loge": log, "log2": log2, "exp": exp,
8989
"ceil": ceil, "floor": floor, "round": round,
9090
"sqrt": sqrt, "": sqrt,
9191
"cbrt": cbrt, // cube root,

Sources/MathParser/Utils.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
// Copyright © 2023 Brad Howes. All rights reserved.
1+
// Copyright © 2023, 2024 Brad Howes. All rights reserved.
22

33
import Foundation
44

55
@inlinable
6-
func factorial(_ n: Double) -> Double { (1...Int(n)).map(Double.init).reduce(1.0, *) }
6+
func factorial(_ value: Double) -> Double { (1...Int(value)).map(Double.init).reduce(1.0, *) }
77

88
@inlinable
99
func multiply(lhs: Token, rhs: Token) -> Token { Token.reducer(lhs: lhs, rhs: rhs, op: (*), name: "*") }

0 commit comments

Comments
 (0)