From 417b08ad3ad36bf69cb2e336c3dbf3d6b17a585a Mon Sep 17 00:00:00 2001 From: Pinghao Wu Date: Wed, 8 Nov 2023 17:06:27 +0800 Subject: [PATCH] update for newer stdlib --- cmd/docker-credential-himitsu/erase.ha | 5 +++-- cmd/docker-credential-himitsu/get.ha | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cmd/docker-credential-himitsu/erase.ha b/cmd/docker-credential-himitsu/erase.ha index 7058e86..2b58151 100644 --- a/cmd/docker-credential-himitsu/erase.ha +++ b/cmd/docker-credential-himitsu/erase.ha @@ -3,10 +3,11 @@ use himitsu::client; use himitsu::query; use net; use os; -use strings; fn erase(hi: net::socket) void = { - const url = strings::fromutf8(bufio::scanline(os::stdin)! as []u8)!; + const scanner = bufio::newscanner(os::stdin, os::BUFSZ); + defer bufio::finish(&scanner); + const url = bufio::scan_line(&scanner)! as const str; const query = query::query { items = [ query::pair { key = "proto", value = "docker", private = false, optional = false}, diff --git a/cmd/docker-credential-himitsu/get.ha b/cmd/docker-credential-himitsu/get.ha index be8dc6f..ad37335 100644 --- a/cmd/docker-credential-himitsu/get.ha +++ b/cmd/docker-credential-himitsu/get.ha @@ -9,7 +9,9 @@ use shlex; use strings; fn get(hi: net::socket) void = { - const url = strings::fromutf8(bufio::scanline(os::stdin)! as []u8)!; + const scanner = bufio::newscanner(os::stdin, os::BUFSZ); + defer bufio::finish(&scanner); + const url = bufio::scan_line(&scanner)! as const str; const query = query::query { items = [ query::pair { key = "proto", value = "docker", private = false, optional = false}, -- 2.45.2