Update the coding style for Zig (#336)

* Update the coding style for Zig

* Update array.rs
This commit is contained in:
sjinzh
2023-02-06 01:14:03 +08:00
committed by GitHub
parent cb73007495
commit 063501068b
26 changed files with 40 additions and 61 deletions
+1 -2
View File
@@ -76,6 +76,5 @@ pub fn main() !void {
std.debug.print("\n输入列表并建立小顶堆后\n", .{});
try inc.PrintUtil.printHeap(i32, mem_allocator, minHeap);
const getchar = try std.io.getStdIn().reader().readByte();
_ = getchar;
_ = try std.io.getStdIn().reader().readByte();
}
+3 -5
View File
@@ -6,7 +6,6 @@ const std = @import("std");
const inc = @import("include");
// 堆类简易实现
// 编译期泛型
pub fn MaxHeap(comptime T: type) type {
return struct {
const Self = @This();
@@ -181,10 +180,9 @@ pub fn main() !void {
std.debug.print("\n堆元素数量为 {}", .{size});
// 判断堆是否为空
var isEmpty = maxHeap.isEmpty();
std.debug.print("\n堆是否为空 {}\n", .{isEmpty});
var is_empty = maxHeap.isEmpty();
std.debug.print("\n堆是否为空 {}\n", .{is_empty});
const getchar = try std.io.getStdIn().reader().readByte();
_ = getchar;
_ = try std.io.getStdIn().reader().readByte();
}