From 19a13e08a8d42b4340cc1b303c326e5091c8ae73 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Fri, 18 Feb 2022 12:23:35 +0300 Subject: chore(journaldriver): Migrate to Rust Edition 2021 Change-Id: I858738b6fc554060824bbb4e69d5ccd03789535d Reviewed-on: https://cl.tvl.fyi/c/depot/+/5309 Tested-by: BuildkiteCI Reviewed-by: sterni Autosubmit: tazjin --- ops/journaldriver/Cargo.toml | 1 + ops/journaldriver/src/main.rs | 25 +++++-------------------- 2 files changed, 6 insertions(+), 20 deletions(-) (limited to 'ops/journaldriver') diff --git a/ops/journaldriver/Cargo.toml b/ops/journaldriver/Cargo.toml index 2c560d14061b..8cd211772684 100644 --- a/ops/journaldriver/Cargo.toml +++ b/ops/journaldriver/Cargo.toml @@ -3,6 +3,7 @@ name = "journaldriver" version = "1.1.0" authors = ["Vincent Ambo "] license = "GPL-3.0-or-later" +edition = "2021" [dependencies] anyhow = "1.0" diff --git a/ops/journaldriver/src/main.rs b/ops/journaldriver/src/main.rs index 1315d49eff49..fb195aab892f 100644 --- a/ops/journaldriver/src/main.rs +++ b/ops/journaldriver/src/main.rs @@ -31,28 +31,13 @@ //! `GOOGLE_APPLICATION_CREDENTIALS`, `GOOGLE_CLOUD_PROJECT` and //! `LOG_NAME` environment variables. -#[macro_use] -extern crate anyhow; -#[macro_use] -extern crate log; -#[macro_use] -extern crate serde_derive; -#[macro_use] -extern crate serde_json; -#[macro_use] -extern crate lazy_static; - -extern crate chrono; -extern crate env_logger; -extern crate medallion; -extern crate serde; -extern crate systemd; -extern crate ureq; - -use anyhow::{Context, Result}; +use anyhow::{bail, format_err, Context, Result}; use chrono::offset::LocalResult; use chrono::prelude::{DateTime, TimeZone, Utc}; -use serde_json::{from_str, Value}; +use lazy_static::lazy_static; +use log::{debug, error, info, trace}; +use serde::{Deserialize, Serialize}; +use serde_json::{from_str, json, Value}; use std::fs::{self, rename, File}; use std::io::{self, ErrorKind, Read, Write}; use std::path::PathBuf; -- cgit 1.4.1