Skip to content

Commit

Permalink
Implement LocalizedError for RustStringRef
Browse files Browse the repository at this point in the history
  • Loading branch information
jnbooth committed Jul 19, 2024
1 parent ab2ca70 commit 8028a5a
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ extension RustStringRef {
__swift_bridge__$RustString$trim(ptr)
}
}
extension RustStringRef: LocalizedError {
public var errorDescription: String? {
return self.as_str().toString()
}
}
extension RustString: Vectorizable {
public static func vecOfSelfNew() -> UnsafeMutableRawPointer {
__swift_bridge__$Vec_RustString$new()
Expand Down Expand Up @@ -94,4 +99,4 @@ extension RustString: Vectorizable {
public static func vecOfSelfLen(vecPtr: UnsafeMutableRawPointer) -> UInt {
__swift_bridge__$Vec_RustString$len(vecPtr)
}
}
}

0 comments on commit 8028a5a

Please sign in to comment.