From 0e7e0ae773c468a678b324aa0428f7aad865e7dc Mon Sep 17 00:00:00 2001 From: Kalle Carlbark Date: Tue, 3 Mar 2020 21:07:21 +0100 Subject: [PATCH] Fix stuff. --- src/main.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index 1804925..c2fb658 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,4 @@ -use serde::{Deserialize}; - +use serde::Deserialize; #[derive(Deserialize)] struct Ip { @@ -8,10 +7,9 @@ struct Ip { #[tokio::main] async fn main() -> Result<(), Box> { - let resp = reqwest::get("https://api.ipify.org?format=json") - .await?; + let resp = reqwest::get("https://api.ipify.org?format=json").await?; let body = resp.text().await?; let ip: Ip = serde_json::from_str(&body)?; - println!("My IP {}", ip.ip); + println!("{}", ip.ip); Ok(()) }