Skip to content

Commit f39b1ab

Browse files
committed
Remove unnecessary @intFromPtr
Now that ziglang/zig#1738 is fixed.
1 parent c3e824a commit f39b1ab

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

tools/lint.zig

+2-4
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,7 @@ const indentRulesMap = std.StaticStringMap(IndentRules).initComptime(.{
138138
// Looks up the indentation rules for the given operator.
139139
fn lookupIndentRules(line: []const u8, operator: []const u8) IndentRules {
140140
var rules = indentRulesMap.get(operator) orelse return .{};
141-
// TODO(https://github.com/ziglang/zig/issues/1738): @intFromPtr should be unnecessary.
142-
const column = @intFromPtr(operator.ptr) - @intFromPtr(line.ptr);
141+
const column = operator.ptr - line.ptr;
143142
// We only recognize wrapper forms occurring at the top level (column 1,
144143
// meaning the open paren is on column 0).
145144
if (column != 1) rules.wrapper = false;
@@ -196,8 +195,7 @@ const ImportBlock = enum {
196195

197196
// Looks up the new import block given the current one and an operator.
198197
fn lookupImportBlock(current: ImportBlock, line: []const u8, operator: []const u8) ImportBlock {
199-
// TODO(https://github.com/ziglang/zig/issues/1738): @intFromPtr should be unnecessary.
200-
const column = @intFromPtr(operator.ptr) - @intFromPtr(line.ptr);
198+
const column = operator.ptr - line.ptr;
201199
switch (current) {
202200
.none => if (column == 1) {
203201
if (std.mem.eql(u8, operator, "Chapter") or

0 commit comments

Comments
 (0)