From 4652bac99810c90a06ca4b49c8d74b773dc3157d Mon Sep 17 00:00:00 2001 From: "Hatter Jiang@Pixelbook" Date: Sat, 31 Aug 2019 15:06:15 +0800 Subject: [PATCH] use util_io::read_to_string --- Cargo.lock | 2 +- src/main.rs | 12 ++---------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 023b88e..1ac02b3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -251,7 +251,7 @@ dependencies = [ [[package]] name = "rust_util" version = "0.1.0" -source = "git+https://github.com/jht5945/rust_util#b15ea1aa7bf90cd13f8b315a6b0303340b6516c5" +source = "git+https://github.com/jht5945/rust_util#c969e39efe99dd6cb6462d2a7a4a3c82c41c3f88" dependencies = [ "term 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "term_size 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/src/main.rs b/src/main.rs index 0eb5ae6..ba5dd29 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,14 +7,12 @@ mod opt; use std::{ fs::{self, File}, - io::{ - self, - prelude::*, - } + io::{self} }; use rust_util::{ XResult, util_msg::*, + util_io::*, }; use opt::*; @@ -30,12 +28,6 @@ Written by Hatter Jiang "#, VERSION, &GIT_HASH[0..7]); } -fn read_to_string(read: &mut dyn Read) -> XResult { - let mut buffer = String::new(); - read.read_to_string(&mut buffer)?; - Ok(buffer) -} - fn main() { let mut options = Options::new();