Skip to content

Commit 2442083

Browse files
committed
Make generic wrappers inlinable for specialization (#784)
1 parent 7febb36 commit 2442083

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

Sources/_StringProcessing/Algorithms/Matching/FirstMatch.swift

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ extension BidirectionalCollection where SubSequence == Substring {
1919
/// - Returns: The first match of `regex` in the collection, or `nil` if
2020
/// there isn't a match.
2121
@available(SwiftStdlib 5.7, *)
22+
@inlinable
2223
public func firstMatch<Output>(
2324
of r: some RegexComponent<Output>
2425
) -> Regex<Output>.Match? {

Sources/_StringProcessing/Regex/Match.swift

+2
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ extension BidirectionalCollection where SubSequence == Substring {
303303
/// - Parameter regex: The regular expression to match.
304304
/// - Returns: The match, if one is found. If there is no match, or a
305305
/// transformation in `regex` throws an error, this method returns `nil`.
306+
@inlinable
306307
public func wholeMatch<R: RegexComponent>(
307308
of regex: R
308309
) -> Regex<R.RegexOutput>.Match? {
@@ -314,6 +315,7 @@ extension BidirectionalCollection where SubSequence == Substring {
314315
/// - Parameter regex: The regular expression to match.
315316
/// - Returns: The match, if one is found. If there is no match, or a
316317
/// transformation in `regex` throws an error, this method returns `nil`.
318+
@inlinable
317319
public func prefixMatch<R: RegexComponent>(
318320
of regex: R
319321
) -> Regex<R.RegexOutput>.Match? {

0 commit comments

Comments
 (0)