Skip to content

Commit

Permalink
chore: removed "extern crate" when possible
Browse files Browse the repository at this point in the history
  • Loading branch information
eko committed Mar 1, 2020
1 parent 07aa62e commit f04d027
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
9 changes: 1 addition & 8 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
#[macro_use]
extern crate log;

#[macro_use]
extern crate prometheus;

#[macro_use]
extern crate serde_derive;

extern crate serde_json;

mod config;
mod tado;

use env_logger::Env;
use log::{info, error};
use tokio;
use std::convert::Infallible;
use std::time::Duration;
Expand Down
4 changes: 2 additions & 2 deletions src/tado/client.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
extern crate reqwest;

use log::{info, error};
use std::vec::Vec;
use reqwest;

use super::model::{AuthApiResponse, MeApiResponse, ZonesApiResponse, ZoneStateApiResponse, ZoneStateResponse};

const AUTH_URL: &'static str = "https://auth.tado.com/oauth/token";
Expand Down
1 change: 1 addition & 0 deletions src/tado/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use std::convert::Infallible;

use super::model::ZoneStateResponse;

use log::info;
use lazy_static::lazy_static;
use hyper::{header::CONTENT_TYPE, Body, Request, Response};
use prometheus::{Encoder, GaugeVec, TextEncoder};
Expand Down
2 changes: 2 additions & 0 deletions src/tado/model.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use serde_derive::Deserialize;

#[derive(Deserialize, Debug)]
pub struct AuthApiResponse {
pub access_token: String,
Expand Down

0 comments on commit f04d027

Please sign in to comment.