Skip to content

Commit b29f1ee

Browse files
author
Harlan Haskins
authored
Merge pull request swiftlang#21527 from nordicio/stdlib_warning_stringstorage
[stdlib] fixes warning: result of call to 'initialize(from:)' is unused
2 parents a5458ac + 121f15b commit b29f1ee

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

stdlib/public/core/StringStorage.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,8 @@ extension _AbstractStringStorage {
7676
fallthrough
7777
case (_cocoaUTF8Encoding, _):
7878
guard maxLength >= count + 1 else { return 0 }
79-
let buffer =
80-
UnsafeMutableBufferPointer(start: outputPtr, count: maxLength)
81-
buffer.initialize(from: UnsafeBufferPointer(start: start, count: count))
79+
let buffer = UnsafeMutableBufferPointer(start: outputPtr, count: maxLength)
80+
_ = buffer.initialize(from: UnsafeBufferPointer(start: start, count: count))
8281
buffer[count] = 0
8382
return 1
8483
default:

0 commit comments

Comments
 (0)