mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-22 01:09:25 +00:00
AK: Tell Swift how to construct AK.StringView from string literals
This commit is contained in:
committed by
Andreas Kling
parent
a3e6856b56
commit
01c4625a42
@@ -22,3 +22,11 @@ extension Swift.String {
|
||||
self.init(data: data, encoding: .utf8)
|
||||
}
|
||||
}
|
||||
|
||||
extension AK.StringView: ExpressibleByStringLiteral {
|
||||
public typealias StringLiteralType = Swift.StaticString
|
||||
|
||||
public init(stringLiteral value: StringLiteralType) {
|
||||
self.init(value.utf8Start, value.utf8CodeUnitCount)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user