We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 61333ed commit a0d0fa7Copy full SHA for a0d0fa7
python/src/lib.rs
@@ -255,8 +255,8 @@ impl FaupCompat {
255
self.url.as_ref()?.fragment.as_deref()
256
}
257
258
- fn get_host(&self) -> Option<String> {
259
- Some(self.url.as_ref()?.host.clone())
+ fn get_host(&self) -> Option<&str> {
+ self.url.as_ref().map(|u| u.host.as_str())
260
261
262
fn get_resource_path(&self) -> Option<&str> {
@@ -271,8 +271,8 @@ impl FaupCompat {
271
self.url.as_ref()?.query.as_deref()
272
273
274
- fn get_scheme(&self) -> Option<String> {
275
- Some(self.url.as_ref()?.scheme.clone())
+ fn get_scheme(&self) -> Option<&str> {
+ self.url.as_ref().map(|u| u.scheme.as_str())
276
277
278
fn get_port(&self) -> Option<u16> {
0 commit comments