1
0
mirror of https://github.com/jht5945/prettyjson.git synced 2025-12-29 18:30:05 +08:00

use util_io::read_to_string

This commit is contained in:
2019-08-31 15:06:15 +08:00
parent 60b051e49e
commit 4652bac998
2 changed files with 3 additions and 11 deletions

2
Cargo.lock generated
View File

@@ -251,7 +251,7 @@ dependencies = [
[[package]] [[package]]
name = "rust_util" name = "rust_util"
version = "0.1.0" version = "0.1.0"
source = "git+https://github.com/jht5945/rust_util#b15ea1aa7bf90cd13f8b315a6b0303340b6516c5" source = "git+https://github.com/jht5945/rust_util#c969e39efe99dd6cb6462d2a7a4a3c82c41c3f88"
dependencies = [ dependencies = [
"term 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", "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)", "term_size 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",

View File

@@ -7,14 +7,12 @@ mod opt;
use std::{ use std::{
fs::{self, File}, fs::{self, File},
io::{ io::{self}
self,
prelude::*,
}
}; };
use rust_util::{ use rust_util::{
XResult, XResult,
util_msg::*, util_msg::*,
util_io::*,
}; };
use opt::*; use opt::*;
@@ -30,12 +28,6 @@ Written by Hatter Jiang
"#, VERSION, &GIT_HASH[0..7]); "#, VERSION, &GIT_HASH[0..7]);
} }
fn read_to_string(read: &mut dyn Read) -> XResult<String> {
let mut buffer = String::new();
read.read_to_string(&mut buffer)?;
Ok(buffer)
}
fn main() { fn main() {
let mut options = Options::new(); let mut options = Options::new();