mirror of
https://github.com/Hopiu/lychee.git
synced 2026-03-30 11:20:24 +00:00
Rename valid_mail to check_mail to be consisten with other check fns
This commit is contained in:
parent
a6ebba6b69
commit
e9ed3f55b9
1 changed files with 2 additions and 2 deletions
|
|
@ -175,7 +175,7 @@ impl Client {
|
|||
Uri::Website(ref url) => self.check_website(&url).await,
|
||||
Uri::Mail(ref address) => {
|
||||
// TODO: We should not be using a HTTP status code for mail
|
||||
match self.valid_mail(&address).await {
|
||||
match self.check_mail(&address).await {
|
||||
true => Status::Ok(http::StatusCode::OK),
|
||||
false => Status::Error(format!("Invalid mail address: {}", address)),
|
||||
}
|
||||
|
|
@ -247,7 +247,7 @@ impl Client {
|
|||
Ok((owner.as_str().into(), repo.as_str().into()))
|
||||
}
|
||||
|
||||
pub async fn valid_mail(&self, address: &str) -> bool {
|
||||
pub async fn check_mail(&self, address: &str) -> bool {
|
||||
let input = CheckEmailInput::new(vec![address.to_string()]);
|
||||
let results = check_email(&input).await;
|
||||
let result = results.get(0);
|
||||
|
|
|
|||
Loading…
Reference in a new issue