File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,22 @@ extension UnsafeMutableBufferPointer: _HasContiguousBytes {
57
57
return try body ( UnsafeRawBufferPointer ( start: ptr, count: len) )
58
58
}
59
59
}
60
+ extension UnsafeRawBufferPointer : _HasContiguousBytes {
61
+ @inlinable @inline ( __always)
62
+ func withUnsafeBytes< R> (
63
+ _ body: ( UnsafeRawBufferPointer ) throws -> R
64
+ ) rethrows -> R {
65
+ return try body ( self )
66
+ }
67
+ }
68
+ extension UnsafeMutableRawBufferPointer : _HasContiguousBytes {
69
+ @inlinable @inline ( __always)
70
+ func withUnsafeBytes< R> (
71
+ _ body: ( UnsafeRawBufferPointer ) throws -> R
72
+ ) rethrows -> R {
73
+ return try body ( UnsafeRawBufferPointer ( self ) )
74
+ }
75
+ }
60
76
extension String : _HasContiguousBytes {
61
77
@inlinable
62
78
internal var _providesContiguousBytesNoCopy : Bool {
You can’t perform that action at this time.
0 commit comments