Skip to content

Commit

Permalink
rust: Stop using extern crate and #[macro_use]
Browse files Browse the repository at this point in the history
Rust 2018 makes this much nicer now.

Closes: #1812
Approved by: lucab
  • Loading branch information
jlebon authored and rh-atomic-bot committed Apr 15, 2019
1 parent 278ba77 commit 6b2ac58
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 29 deletions.
6 changes: 2 additions & 4 deletions rust/src/journal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

extern crate systemd;

use self::systemd::id128::Id128;
use self::systemd::journal;
use failure::Fallible;
use systemd::id128::Id128;
use systemd::journal;

static OSTREE_FINALIZE_STAGED_SERVICE: &'static str = "ostree-finalize-staged.service";
static OSTREE_DEPLOYMENT_FINALIZING_MSG_ID: &'static str = "e8646cd63dff4625b77909a8e7a40994";
Expand Down
22 changes: 0 additions & 22 deletions rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

extern crate c_utf8;
extern crate clap;
extern crate curl;
#[macro_use]
extern crate failure;
extern crate gio_sys;
extern crate glib;
extern crate glib_sys;
extern crate indicatif;
extern crate libc;
extern crate openat;
extern crate rayon;
extern crate tempfile;

#[macro_use]
extern crate lazy_static;
#[macro_use]
extern crate serde_derive;
extern crate serde;
extern crate serde_json;
extern crate serde_yaml;

// pub(crate) utilities
mod ffiutil;
mod openat_utils;
Expand Down
3 changes: 1 addition & 2 deletions rust/src/progress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

extern crate indicatif;

use indicatif::{ProgressBar, ProgressDrawTarget, ProgressStyle};
use lazy_static::lazy_static;
use std::borrow::Cow;
use std::sync::Mutex;

Expand Down
1 change: 1 addition & 0 deletions rust/src/treefile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use c_utf8::CUtf8Buf;
use failure::Fallible;
use failure::ResultExt;
use openat;
use serde_derive::{Deserialize, Serialize};
use serde_json;
use serde_yaml;
use std::collections::HashMap;
Expand Down
2 changes: 1 addition & 1 deletion rust/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/

use failure::Fallible;
use failure::{bail, Fallible};
use std::collections::HashMap;
use std::io::prelude::*;
use std::{fs, io};
Expand Down

0 comments on commit 6b2ac58

Please sign in to comment.