Skip to content

Commit d823ead

Browse files
committed
Update Trace.swift
1 parent e78e6e3 commit d823ead

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

Sources/Logger/helper/Trace.swift

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,22 +44,20 @@ extension String {
4444
* trim function removes the specified prefix and suffix from the string.
4545
*/
4646
fileprivate mutating func trim(left: String, right: String) {
47-
self = removePrefix(prefix: left) // Remove the left prefix from the trace message
48-
self = removeSuffix(suffix: right) // Remove the right suffix from the trace message
47+
self = trimmingPrefix(prefix: left) // Remove the left prefix from the trace message
48+
self = trimmingSuffix(suffix: right) // Remove the right suffix from the trace message
4949
}
5050
/**
5151
* removePrefix function removes the specified prefix from the string.
52-
* fixme: rename trimmingPrefix
5352
*/
54-
fileprivate func removePrefix(prefix: String) -> String {
53+
fileprivate func trimmingPrefix(prefix: String) -> String {
5554
guard self.hasPrefix(prefix) else { return self } // Check if the trace message has the specified prefix
5655
return "\(self.dropFirst(prefix.count))" // Remove the prefix from the trace message and return the result
5756
}
5857
/**
5958
* removeSuffix function removes the specified suffix from the string.
60-
* fixme: rename trimmingSuffix
6159
*/
62-
fileprivate func removeSuffix(suffix: String) -> String {
60+
fileprivate func trimmingSuffix(suffix: String) -> String {
6361
guard self.hasSuffix(suffix) else { return self } // Check if the trace message has the specified suffix
6462
return "\(self.dropLast(suffix.count))" // Remove the suffix from the trace message and return the result
6563
}

0 commit comments

Comments
 (0)