Skip to content

Commit 7aa36e0

Browse files
committed
fix: issues
1 parent 1724821 commit 7aa36e0

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

python/pydantic_core/_pydantic_core.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ class MultiHostUrl(SupportsAllComparisons):
224224
scheme: str,
225225
user: Optional[str] = None,
226226
password: Optional[str] = None,
227-
host: str,
227+
host: Optional[str] = None,
228228
hosts: Optional[dict] = None,
229229
port: Optional[str] = None,
230230
path: Optional[str] = None,

src/url.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -389,9 +389,9 @@ impl PyMultiHostUrl {
389389
"expected one of 'host', 'username', 'password' or 'port' to be set",
390390
));
391391
}
392-
multi_url.push_str(&*single_host.to_string());
392+
multi_url.push_str(&single_host.to_string());
393393
if index != hosts.len() - 1 {
394-
multi_url.push(',')
394+
multi_url.push(',');
395395
};
396396
}
397397
multi_url
@@ -458,19 +458,19 @@ impl fmt::Display for MultiHostUrlHost {
458458
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
459459
let mut url = String::new();
460460
if self.username.is_some() && self.password.is_some() {
461-
url.push_str(&*format!(
461+
url.push_str(&format!(
462462
"{}:{}",
463463
self.username.as_ref().unwrap(),
464464
self.password.as_ref().unwrap()
465-
))
465+
));
466466
}
467467
if self.host.is_some() {
468-
url.push_str(&*format!("@{}", self.host.as_ref().unwrap()))
468+
url.push_str(&format!("@{}", self.host.as_ref().unwrap()));
469469
}
470470
if self.port.is_some() {
471-
url.push_str(&*format!(":{}", self.port.as_ref().unwrap()))
471+
url.push_str(&format!(":{}", self.port.as_ref().unwrap()));
472472
}
473-
write!(f, "{}", url)
473+
write!(f, "{url}")
474474
}
475475
}
476476

0 commit comments

Comments
 (0)