We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
base_url
1 parent a5e6e12 commit 9024c83Copy full SHA for 9024c83
src/lib.rs
@@ -29,21 +29,24 @@ impl UrlPattern {
29
} else if value.is_none() {
30
(None, options)
31
} else {
32
- (
33
- Some(
34
- value
35
- .extract::<String>()?
36
- .parse::<url::Url>()
37
- .map_err(::urlpattern::Error::Url)
38
- .map_err(Error)?,
39
- ),
40
- options,
41
- )
+ (base_url, options)
42
}
43
44
None => (None, options),
45
};
46
+ let base_url = if let Some(base_url) = base_url {
+ Some(
+ base_url
+ .extract::<String>()?
+ .parse::<url::Url>()
+ .map_err(::urlpattern::Error::Url)
+ .map_err(Error)?,
+ )
+ } else {
47
+ None
48
+ };
49
+
50
let options = if let Some(options) = options {
51
::urlpattern::UrlPatternOptions {
52
ignore_case: options
0 commit comments