configure: simplify get_autoconfig()

This commit is contained in:
Alexander Krotov
2021-01-03 21:50:46 +03:00
committed by link2xt
parent 0f90d50385
commit 31ae099e19
3 changed files with 64 additions and 73 deletions

View File

@@ -251,10 +251,10 @@ fn parse_serverparams(in_emailaddr: &str, xml_raw: &str) -> Result<Vec<ServerPar
pub(crate) async fn moz_autoconfigure(
context: &Context,
url: &str,
url: impl AsRef<str>,
param_in: &LoginParam,
) -> Result<Vec<ServerParams>, Error> {
let xml_raw = read_url(context, url).await?;
let xml_raw = read_url(context, url.as_ref()).await?;
let res = parse_serverparams(&param_in.addr, &xml_raw);
if let Err(err) = &res {