diff --git a/CMakeLists.txt b/CMakeLists.txt index d0445759f135..49dde70f5e29 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -377,7 +377,7 @@ set(ZIG_STAGE2_SOURCES "${CMAKE_SOURCE_DIR}/lib/std/io/change_detection_stream.zig" "${CMAKE_SOURCE_DIR}/lib/std/io/counting_writer.zig" "${CMAKE_SOURCE_DIR}/lib/std/io/counting_reader.zig" - "${CMAKE_SOURCE_DIR}/lib/std/io/find_byte_out_stream.zig" + "${CMAKE_SOURCE_DIR}/lib/std/io/find_byte_writer.zig" "${CMAKE_SOURCE_DIR}/lib/std/io/fixed_buffer_stream.zig" "${CMAKE_SOURCE_DIR}/lib/std/io/reader.zig" "${CMAKE_SOURCE_DIR}/lib/std/io/seekable_stream.zig" diff --git a/lib/std/io.zig b/lib/std/io.zig index 3d8744d74d3b..fb5f00805c47 100644 --- a/lib/std/io.zig +++ b/lib/std/io.zig @@ -145,8 +145,12 @@ pub const autoIndentingStream = @import("io/auto_indenting_stream.zig").autoInde pub const ChangeDetectionStream = @import("io/change_detection_stream.zig").ChangeDetectionStream; pub const changeDetectionStream = @import("io/change_detection_stream.zig").changeDetectionStream; -pub const FindByteOutStream = @import("io/find_byte_out_stream.zig").FindByteOutStream; -pub const findByteOutStream = @import("io/find_byte_out_stream.zig").findByteOutStream; +pub const FindByteWriter = @import("io/find_byte_writer.zig").FindByteWriter; +pub const findByteWriter = @import("io/find_byte_writer.zig").findByteWriter; +/// Deprecated: use `FindByteWriter`. +pub const FindByteOutStream = FindByteWriter; +/// Deprecated: use `findByteWriter`. +pub const findByteOutStream = findByteWriter; pub const BufferedAtomicFile = @import("io/buffered_atomic_file.zig").BufferedAtomicFile; diff --git a/lib/std/io/find_byte_out_stream.zig b/lib/std/io/find_byte_writer.zig similarity index 79% rename from lib/std/io/find_byte_out_stream.zig rename to lib/std/io/find_byte_writer.zig index e0e8fa871cc4..db45114d3e4e 100644 --- a/lib/std/io/find_byte_out_stream.zig +++ b/lib/std/io/find_byte_writer.zig @@ -8,9 +8,9 @@ const std = @import("../std.zig"); const io = std.io; const assert = std.debug.assert; -/// An OutStream that returns whether the given character has been written to it. +/// A Writer that returns whether the given character has been written to it. /// The contents are not written to anything. -pub fn FindByteOutStream(comptime UnderlyingWriter: type) type { +pub fn FindByteWriter(comptime UnderlyingWriter: type) type { return struct { const Self = @This(); pub const Error = UnderlyingWriter.Error; @@ -37,8 +37,8 @@ pub fn FindByteOutStream(comptime UnderlyingWriter: type) type { }; } -pub fn findByteOutStream(byte: u8, underlying_writer: anytype) FindByteOutStream(@TypeOf(underlying_writer)) { - return FindByteOutStream(@TypeOf(underlying_writer)){ +pub fn findByteWriter(byte: u8, underlying_writer: anytype) FindByteWriter(@TypeOf(underlying_writer)) { + return FindByteWriter(@TypeOf(underlying_writer)){ .underlying_writer = underlying_writer, .byte = byte, .byte_found = false, diff --git a/lib/std/zig/render.zig b/lib/std/zig/render.zig index 8d2d37b76ae2..3cced0dd6ba6 100644 --- a/lib/std/zig/render.zig +++ b/lib/std/zig/render.zig @@ -790,7 +790,7 @@ fn renderExpression( const section_exprs = row_exprs[0..section_end]; // Null stream for counting the printed length of each expression - var line_find_stream = std.io.findByteOutStream('\n', std.io.null_writer); + var line_find_stream = std.io.findByteWriter('\n', std.io.null_writer); var counting_stream = std.io.countingWriter(line_find_stream.writer()); var auto_indenting_stream = std.io.autoIndentingStream(indent_delta, counting_stream.writer()); @@ -954,7 +954,7 @@ fn renderExpression( const expr_outputs_one_line = blk: { // render field expressions until a LF is found for (field_inits) |field_init| { - var find_stream = std.io.findByteOutStream('\n', std.io.null_writer); + var find_stream = std.io.findByteWriter('\n', std.io.null_writer); var auto_indenting_stream = std.io.autoIndentingStream(indent_delta, find_stream.writer()); try renderExpression(allocator, &auto_indenting_stream, tree, field_init, Space.None);