mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
don't forget to advance in the deprecated adapter
This commit is contained in:
parent
6038192fad
commit
4fcb479de9
@ -334,10 +334,12 @@ pub fn GenericReader(
|
||||
fn stream(r: *Reader, w: *Writer, limit: Limit) Reader.StreamError!usize {
|
||||
const a: *@This() = @alignCast(@fieldParentPtr("new_interface", r));
|
||||
const buf = limit.slice(try w.writableSliceGreedy(1));
|
||||
return a.derp_reader.read(buf) catch |err| {
|
||||
const n = a.derp_reader.read(buf) catch |err| {
|
||||
a.err = err;
|
||||
return error.ReadFailed;
|
||||
};
|
||||
w.advance(n);
|
||||
return n;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@ -393,10 +393,12 @@ pub const Adapter = struct {
|
||||
fn stream(r: *std.io.Reader, w: *std.io.Writer, limit: std.io.Limit) std.io.Reader.StreamError!usize {
|
||||
const a: *@This() = @alignCast(@fieldParentPtr("new_interface", r));
|
||||
const buf = limit.slice(try w.writableSliceGreedy(1));
|
||||
return a.derp_reader.read(buf) catch |err| {
|
||||
const n = a.derp_reader.read(buf) catch |err| {
|
||||
a.err = err;
|
||||
return error.ReadFailed;
|
||||
};
|
||||
w.advance(n);
|
||||
return n;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user