aboutsummaryrefslogtreecommitdiff
path: root/lib/std/io/fixed_buffer_stream.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-06-16 13:45:33 -0700
committerGitHub <noreply@github.com>2023-06-16 13:45:33 -0700
commit537104fd9d84d94abad3e36d3cd781be4397e299 (patch)
treea77492de657f8a76c15bdeb443916490db79e1cd /lib/std/io/fixed_buffer_stream.zig
parent5d9e8f27d0dc131e0b4154c5f65376f2fb9f3500 (diff)
parent2af5bd8aa8711b2a6e60f961290372134090f235 (diff)
downloadzig-537104fd9d84d94abad3e36d3cd781be4397e299.tar.gz
zig-537104fd9d84d94abad3e36d3cd781be4397e299.zip
Merge pull request #16025 from mlugg/feat/remove-std-math-minmax
Consider bounds when refining @min/@max result type; deprecate std.math.{min,max,min3,max3}
Diffstat (limited to 'lib/std/io/fixed_buffer_stream.zig')
-rw-r--r--lib/std/io/fixed_buffer_stream.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/std/io/fixed_buffer_stream.zig b/lib/std/io/fixed_buffer_stream.zig
index c170dd1f74..27b978744c 100644
--- a/lib/std/io/fixed_buffer_stream.zig
+++ b/lib/std/io/fixed_buffer_stream.zig
@@ -76,7 +76,7 @@ pub fn FixedBufferStream(comptime Buffer: type) type {
}
pub fn seekTo(self: *Self, pos: u64) SeekError!void {
- self.pos = if (std.math.cast(usize, pos)) |x| std.math.min(self.buffer.len, x) else self.buffer.len;
+ self.pos = if (std.math.cast(usize, pos)) |x| @min(self.buffer.len, x) else self.buffer.len;
}
pub fn seekBy(self: *Self, amt: i64) SeekError!void {
@@ -91,7 +91,7 @@ pub fn FixedBufferStream(comptime Buffer: type) type {
} else {
const amt_usize = std.math.cast(usize, amt) orelse std.math.maxInt(usize);
const new_pos = std.math.add(usize, self.pos, amt_usize) catch std.math.maxInt(usize);
- self.pos = std.math.min(self.buffer.len, new_pos);
+ self.pos = @min(self.buffer.len, new_pos);
}
}