~vpzom/shoved

39aaf816074fe62a01e0bc75647b618dd6808aa9 — Colin Reeder 11 months ago a00ac04
Return only the result JSON from shoved-register
1 files changed, 7 insertions(+), 2 deletions(-)

M src/bin/register.rs
M src/bin/register.rs => src/bin/register.rs +7 -2
@@ 1,4 1,4 @@
use std::io::Write;
use std::io::{Read, Write};

fn main() {
    let mut args = std::env::args();


@@ 47,5 47,10 @@ fn main() {

    stream.shutdown(std::net::Shutdown::Write).unwrap();

    std::io::copy(&mut stream, &mut std::io::stdout()).unwrap();
    let mut body = Vec::new();
    stream.read_to_end(&mut body).unwrap();

    let body: serde_json::Value = serde_json::from_slice(&body).unwrap();

    println!("{}", body["result"]);
}