Skip to content

Commit 5b79927

Browse files
committed
Move platform-specific imports into functions that use them.
1 parent 50e3ed7 commit 5b79927

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22

33
name = "url"
4-
version = "0.2.30"
4+
version = "0.2.31"
55
authors = [ "Simon Sapin <simon.sapin@exyr.org>" ]
66

77
description = "URL parser for Rust"

src/lib.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,7 @@ use std::path::{Path, PathBuf};
130130
pub use host::{Host, Ipv6Address};
131131
pub use parser::{ErrorHandler, ParseResult, ParseError};
132132

133-
use percent_encoding::{
134-
percent_decode, percent_decode_to, percent_encode, lossy_utf8_percent_decode, DEFAULT_ENCODE_SET,
135-
};
133+
use percent_encoding::{percent_encode, lossy_utf8_percent_decode, DEFAULT_ENCODE_SET};
136134

137135
use format::{PathFormatter, UserInfoFormatter, UrlNoFragmentFormatter};
138136
use encoding::EncodingOverride;
@@ -966,6 +964,8 @@ fn file_url_path_to_pathbuf(path: &[String]) -> Result<PathBuf, ()> {
966964
use std::os::unix::prelude::OsStrExt;
967965
use std::path::PathBuf;
968966

967+
use percent_encoding::percent_decode_to;
968+
969969
if path.is_empty() {
970970
return Ok(PathBuf::from("/"))
971971
}
@@ -983,6 +983,8 @@ fn file_url_path_to_pathbuf(path: &[String]) -> Result<PathBuf, ()> {
983983

984984
#[cfg(windows)]
985985
fn file_url_path_to_pathbuf(path: &[String]) -> Result<PathBuf, ()> {
986+
use percent_encoding::percent_decode;
987+
986988
if path.is_empty() {
987989
return Err(())
988990
}

0 commit comments

Comments
 (0)