update depreciated code (#7502)

* `zig env`:

* fix depreciated interface, update outStream -> writer
* make code more readable by updating `anytype` -> `std.fs.File.Writer`
This commit is contained in:
g-w1
2020-12-23 06:01:29 -05:00
committed by GitHub
parent 4128eea00c
commit 51a904677c
5 changed files with 29 additions and 29 deletions

View File

@@ -239,8 +239,8 @@ pub fn main() !void {
const vers_txt_path = try fs.path.join(allocator, &[_][]const u8{ glibc_out_dir, "vers.txt" });
const vers_txt_file = try fs.cwd().createFile(vers_txt_path, .{});
defer vers_txt_file.close();
var buffered = std.io.bufferedOutStream(vers_txt_file.outStream());
const vers_txt = buffered.outStream();
var buffered = std.io.bufferedOutStream(vers_txt_file.writer());
const vers_txt = buffered.writer();
for (global_ver_list) |name, i| {
_ = global_ver_set.put(name, i) catch unreachable;
try vers_txt.print("{}\n", .{name});
@@ -251,8 +251,8 @@ pub fn main() !void {
const fns_txt_path = try fs.path.join(allocator, &[_][]const u8{ glibc_out_dir, "fns.txt" });
const fns_txt_file = try fs.cwd().createFile(fns_txt_path, .{});
defer fns_txt_file.close();
var buffered = std.io.bufferedOutStream(fns_txt_file.outStream());
const fns_txt = buffered.outStream();
var buffered = std.io.bufferedOutStream(fns_txt_file.writer());
const fns_txt = buffered.writer();
for (global_fn_list) |name, i| {
const entry = global_fn_set.getEntry(name).?;
entry.value.index = i;
@@ -282,8 +282,8 @@ pub fn main() !void {
const abilist_txt_path = try fs.path.join(allocator, &[_][]const u8{ glibc_out_dir, "abi.txt" });
const abilist_txt_file = try fs.cwd().createFile(abilist_txt_path, .{});
defer abilist_txt_file.close();
var buffered = std.io.bufferedOutStream(abilist_txt_file.outStream());
const abilist_txt = buffered.outStream();
var buffered = std.io.bufferedOutStream(abilist_txt_file.writer());
const abilist_txt = buffered.writer();
// first iterate over the abi lists
for (abi_lists) |*abi_list, abi_index| {