about summary refs log tree commit diff
path: root/ops/journaldriver
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-02-18T09·23+0300
committerclbot <clbot@tvl.fyi>2022-02-18T11·52+0000
commit19a13e08a8d42b4340cc1b303c326e5091c8ae73 (patch)
tree45eb5eec2c14a48894cceb6bd3c4ad3fcb4164f6 /ops/journaldriver
parentc075a2c5414e00f29304618d7dcc136a0be76d46 (diff)
chore(journaldriver): Migrate to Rust Edition 2021 r/3854
Change-Id: I858738b6fc554060824bbb4e69d5ccd03789535d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/5309
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Autosubmit: tazjin <tazjin@tvl.su>
Diffstat (limited to 'ops/journaldriver')
-rw-r--r--ops/journaldriver/Cargo.toml1
-rw-r--r--ops/journaldriver/src/main.rs25
2 files changed, 6 insertions, 20 deletions
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 <mail@tazj.in>"]
 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;