diff options
Diffstat (limited to 'components/config')
-rw-r--r-- | components/config/lib.rs | 8 | ||||
-rw-r--r-- | components/config/opts.rs | 5 | ||||
-rw-r--r-- | components/config/pref_util.rs | 1 | ||||
-rw-r--r-- | components/config/prefs.rs | 2 | ||||
-rw-r--r-- | components/config/tests/prefs.rs | 4 |
5 files changed, 9 insertions, 11 deletions
diff --git a/components/config/lib.rs b/components/config/lib.rs index 0da6c32f0e6..ce19ea49849 100644 --- a/components/config/lib.rs +++ b/components/config/lib.rs @@ -4,15 +4,7 @@ #![deny(unsafe_code)] -#[macro_use] -extern crate lazy_static; -#[macro_use] -extern crate log; -#[macro_use] -extern crate serde; - pub mod pref_util; -#[macro_use] pub mod prefs; pub mod basedir; diff --git a/components/config/opts.rs b/components/config/opts.rs index 95675c0b9c1..9d3806d67b5 100644 --- a/components/config/opts.rs +++ b/components/config/opts.rs @@ -7,6 +7,9 @@ use euclid::Size2D; use getopts::{Matches, Options}; +use lazy_static::lazy_static; +use log::error; +use serde::{Deserialize, Serialize}; use servo_geometry::DeviceIndependentPixel; use servo_url::ServoUrl; use std::default::Default; @@ -19,6 +22,8 @@ use std::sync::atomic::{AtomicBool, Ordering}; use std::sync::{RwLock, RwLockReadGuard}; use url::{self, Url}; +use crate::{pref, set_pref}; + /// Global flags for Servo, currently set on the command line. #[derive(Clone, Debug, Deserialize, Serialize)] pub struct Opts { diff --git a/components/config/pref_util.rs b/components/config/pref_util.rs index 75b83efae88..a052147e427 100644 --- a/components/config/pref_util.rs +++ b/components/config/pref_util.rs @@ -2,6 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ +use serde::{Deserialize, Serialize}; use serde_json::Value; use std::collections::HashMap; use std::fmt; diff --git a/components/config/prefs.rs b/components/config/prefs.rs index 82f3884bf70..13d8d6753ce 100644 --- a/components/config/prefs.rs +++ b/components/config/prefs.rs @@ -3,6 +3,7 @@ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ use embedder_traits::resources::{self, Resource}; +use lazy_static::lazy_static; use serde_json::{self, Value}; use std::borrow::ToOwned; use std::collections::HashMap; @@ -85,6 +86,7 @@ pub fn read_prefs_map(txt: &str) -> Result<HashMap<String, PrefValue>, PrefError } mod gen { + use serde::{Deserialize, Serialize}; use servo_config_plugins::build_structs; // The number of layout threads is calculated if it is not present in `prefs.json`. diff --git a/components/config/tests/prefs.rs b/components/config/tests/prefs.rs index 63d4475769b..f19b7e84676 100644 --- a/components/config/tests/prefs.rs +++ b/components/config/tests/prefs.rs @@ -2,9 +2,6 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#[macro_use] -extern crate serde; - use servo_config::basedir; use servo_config::pref_util::Preferences; use servo_config::prefs::{read_prefs_map, PrefValue}; @@ -303,6 +300,7 @@ static WITHOUT_DEFAULTS_JSON_STR: &'static str = r#"{ }"#; mod gen { + use serde::{Deserialize, Serialize}; use servo_config::pref_util::{Accessor, PrefValue}; use servo_config_plugins::build_structs; |