File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
stdlib/public/libexec/swift-backtrace Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -211,7 +211,7 @@ extension Sequence {
211
211
/// This is not, in general, a safe thing to do, because the sequence might
212
212
/// not be restartable. For the cases where we're using it here, it's OK
213
213
/// though.
214
- public var unsafeFirst : Element ? {
214
+ var consumingFirst : Element ? {
215
215
var iterator = makeIterator ( )
216
216
return iterator. next ( )
217
217
}
Original file line number Diff line number Diff line change @@ -1008,14 +1008,14 @@ Generate a backtrace for the parent process.
1008
1008
let formatter = backtraceFormatter ( )
1009
1009
switch thread. backtrace {
1010
1010
case let . raw( backtrace) :
1011
- if let frame = backtrace. frames. unsafeFirst {
1011
+ if let frame = backtrace. frames. consumingFirst {
1012
1012
let formatted = formatter. format ( frame: frame)
1013
1013
writeln ( " \( formatted) " )
1014
1014
}
1015
1015
case let . symbolicated( backtrace) :
1016
1016
if let frame = backtrace. frames. drop ( while: {
1017
1017
$0. isSwiftRuntimeFailure
1018
- } ) . unsafeFirst {
1018
+ } ) . consumingFirst {
1019
1019
let formatted = formatter. format ( frame: frame)
1020
1020
writeln ( " \( formatted) " )
1021
1021
}
@@ -1087,7 +1087,7 @@ Generate a backtrace for the parent process.
1087
1087
1088
1088
switch thread. backtrace {
1089
1089
case let . raw( backtrace) :
1090
- if let frame = backtrace. frames. unsafeFirst {
1090
+ if let frame = backtrace. frames. consumingFirst {
1091
1091
rows += formatter. formatRows (
1092
1092
frame: frame
1093
1093
) . map { row in
@@ -1103,7 +1103,7 @@ Generate a backtrace for the parent process.
1103
1103
case let . symbolicated( backtrace) :
1104
1104
if let frame = backtrace. frames. drop ( while: {
1105
1105
$0. isSwiftRuntimeFailure
1106
- } ) . unsafeFirst {
1106
+ } ) . consumingFirst {
1107
1107
rows += formatter. formatRows (
1108
1108
frame: frame
1109
1109
) . map { row in
You can’t perform that action at this time.
0 commit comments