Skip to content

Commit 762dbc1

Browse files
committed
Use fatalError() for no-op methods
1 parent 7b577a7 commit 762dbc1

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Sources/Subprocess/IO/Input.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public struct NoInput: InputProtocol {
6565
/// Asynchronously write the input to the subprocess that uses the
6666
/// write file descriptor.
6767
public func write(with writer: StandardInputWriter) async throws {
68-
// noop
68+
fatalError("Unexpected call to \(#function)")
6969
}
7070

7171
internal init() {}
@@ -97,7 +97,7 @@ public struct FileDescriptorInput: InputProtocol {
9797
/// Asynchronously write the input to the subprocess that use the
9898
/// write file descriptor.
9999
public func write(with writer: StandardInputWriter) async throws {
100-
// noop
100+
fatalError("Unexpected call to \(#function)")
101101
}
102102

103103
internal init(
@@ -155,7 +155,7 @@ internal struct CustomWriteInput: InputProtocol {
155155
/// Asynchronously write the input to the subprocess using the
156156
/// write file descriptor.
157157
public func write(with writer: StandardInputWriter) async throws {
158-
// noop
158+
fatalError("Unexpected call to \(#function)")
159159
}
160160

161161
internal init() {}

Sources/Subprocess/IO/Output.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,12 +354,12 @@ extension OutputProtocol where OutputType == Void {
354354
#if SubprocessSpan
355355
/// Convert the output from raw span to expected output type
356356
public func output(from span: RawSpan) throws {
357-
// noop
357+
fatalError("Unexpected call to \(#function)")
358358
}
359359
#endif
360360
/// Convert the output from a sequence of 8-bit unsigned integers to expected output type.
361361
public func output(from buffer: some Sequence<UInt8>) throws {
362-
// noop
362+
fatalError("Unexpected call to \(#function)")
363363
}
364364
}
365365

0 commit comments

Comments
 (0)