diff options
author | Corey Farwell <coreyf@rwell.org> | 2016-11-11 21:43:50 -0500 |
---|---|---|
committer | Corey Farwell <coreyf@rwell.org> | 2016-11-11 23:41:22 -0500 |
commit | 6a101921c469b3e90e945cc86397ce520f3d5981 (patch) | |
tree | cbe926d9249a35e4fc35e4f63e7df9e216b8abd7 | |
parent | f0020297f58cfa85b06577ab4e8ce7be7a01ac6d (diff) | |
download | servo-6a101921c469b3e90e945cc86397ce520f3d5981.tar.gz servo-6a101921c469b3e90e945cc86397ce520f3d5981.zip |
Store directory path as `PathBuf` instead of `String`.
-rw-r--r-- | components/servo/lib.rs | 5 | ||||
-rw-r--r-- | components/util/opts.rs | 4 |
2 files changed, 5 insertions, 4 deletions
diff --git a/components/servo/lib.rs b/components/servo/lib.rs index 8962c2f47d7..21ad6a134a0 100644 --- a/components/servo/lib.rs +++ b/components/servo/lib.rs @@ -89,6 +89,7 @@ use profile_traits::time; use script_traits::{ConstellationMsg, SWManagerSenders, ScriptMsg}; use std::borrow::Cow; use std::cmp::max; +use std::path::PathBuf; use std::rc::Rc; use std::sync::mpsc::Sender; use url::Url; @@ -243,7 +244,7 @@ impl<Window> Browser<Window> where Window: WindowMethods + 'static { } fn create_constellation(user_agent: Cow<'static, str>, - config_dir: Option<String>, + config_dir: Option<PathBuf>, url: Option<Url>, compositor_proxy: Box<CompositorProxy + Send>, time_profiler_chan: time::ProfilerChan, @@ -259,7 +260,7 @@ fn create_constellation(user_agent: Cow<'static, str>, new_resource_threads(user_agent, devtools_chan.clone(), time_profiler_chan.clone(), - config_dir.map(Into::into)); + config_dir); let image_cache_thread = new_image_cache_thread(public_resource_threads.sender(), webrender_api_sender.create_api()); let font_cache_thread = FontCacheThread::new(public_resource_threads.sender(), diff --git a/components/util/opts.rs b/components/util/opts.rs index cf7c5cafed2..1d032a07d08 100644 --- a/components/util/opts.rs +++ b/components/util/opts.rs @@ -215,7 +215,7 @@ pub struct Opts { pub use_msaa: bool, /// Directory for a default config directory - pub config_dir: Option<String>, + pub config_dir: Option<PathBuf>, // don't skip any backtraces on panic pub full_backtraces: bool, @@ -857,7 +857,7 @@ pub fn from_cmdline_args(args: &[String]) -> ArgumentParsingResult { enable_vsync: !debug_options.disable_vsync, webrender_stats: debug_options.webrender_stats, use_msaa: debug_options.use_msaa, - config_dir: opt_match.opt_str("config-dir"), + config_dir: opt_match.opt_str("config-dir").map(Into::into), full_backtraces: debug_options.full_backtraces, is_printing_version: is_printing_version, webrender_debug: debug_options.webrender_debug, |