File tree Expand file tree Collapse file tree 1 file changed +4
-20
lines changed Expand file tree Collapse file tree 1 file changed +4
-20
lines changed Original file line number Diff line number Diff line change @@ -98,26 +98,10 @@ pub struct UrlComponents {
98
98
99
99
impl From < & ffi:: ada_url_components > for UrlComponents {
100
100
fn from ( value : & ffi:: ada_url_components ) -> Self {
101
- let port = if value. port == u32:: MAX {
102
- None
103
- } else {
104
- Some ( value. port )
105
- } ;
106
- let pathname_start = if value. pathname_start == u32:: MAX {
107
- None
108
- } else {
109
- Some ( value. pathname_start )
110
- } ;
111
- let search_start = if value. search_start == u32:: MAX {
112
- None
113
- } else {
114
- Some ( value. search_start )
115
- } ;
116
- let hash_start = if value. hash_start == u32:: MAX {
117
- None
118
- } else {
119
- Some ( value. hash_start )
120
- } ;
101
+ let port = ( value. port != u32:: MAX ) . then_some ( value. port ) ;
102
+ let pathname_start = ( value. pathname_start != u32:: MAX ) . then_some ( value. pathname_start ) ;
103
+ let search_start = ( value. search_start != u32:: MAX ) . then_some ( value. search_start ) ;
104
+ let hash_start = ( value. hash_start != u32:: MAX ) . then_some ( value. hash_start ) ;
121
105
Self {
122
106
protocol_end : value. protocol_end ,
123
107
username_end : value. username_end ,
You can’t perform that action at this time.
0 commit comments