mirror of
https://github.com/jht5945/prettyjson.git
synced 2025-12-27 17:20:05 +08:00
use util_io::read_to_string
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -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)",
|
||||
|
||||
12
src/main.rs
12
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<String> {
|
||||
let mut buffer = String::new();
|
||||
read.read_to_string(&mut buffer)?;
|
||||
Ok(buffer)
|
||||
}
|
||||
|
||||
|
||||
fn main() {
|
||||
let mut options = Options::new();
|
||||
|
||||
Reference in New Issue
Block a user