aboutsummaryrefslogtreecommitdiff
path: root/lib/std/math.zig
diff options
context:
space:
mode:
authormlugg <mlugg@mlugg.co.uk>2023-11-10 05:27:17 +0000
committermlugg <mlugg@mlugg.co.uk>2023-11-19 09:55:07 +0000
commit51595d6b75d8ac2443a2c142c71f2a617c12fe96 (patch)
tree0e3045793aa36cc8569181cc790d270c4f056806 /lib/std/math.zig
parentbaabc6013ea4f44082e69375214e76b5d803c5cb (diff)
downloadzig-51595d6b75d8ac2443a2c142c71f2a617c12fe96.tar.gz
zig-51595d6b75d8ac2443a2c142c71f2a617c12fe96.zip
lib: correct unnecessary uses of 'var'
Diffstat (limited to 'lib/std/math.zig')
-rw-r--r--lib/std/math.zig3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/std/math.zig b/lib/std/math.zig
index 57471e2b03..1710cdc948 100644
--- a/lib/std/math.zig
+++ b/lib/std/math.zig
@@ -427,6 +427,7 @@ test "clamp" {
// Mix of comptime and non-comptime
var i: i32 = 1;
+ _ = &i;
try testing.expect(std.math.clamp(i, 0, 1) == 1);
}
@@ -1113,7 +1114,7 @@ pub fn ceilPowerOfTwo(comptime T: type, value: T) (error{Overflow}!T) {
comptime assert(info.signedness == .unsigned);
const PromotedType = std.meta.Int(info.signedness, info.bits + 1);
const overflowBit = @as(PromotedType, 1) << info.bits;
- var x = ceilPowerOfTwoPromote(T, value);
+ const x = ceilPowerOfTwoPromote(T, value);
if (overflowBit & x != 0) {
return error.Overflow;
}