mirror of
https://gitlab.gnome.org/World/Authenticator.git
synced 2025-03-04 00:34:40 +01:00
Favicon: Fix tests
This commit is contained in:
parent
4f979d246a
commit
56e196346f
1 changed files with 9 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
|||
use tokio::{io::AsyncWriteExt, sync::Mutex};
|
||||
use image::io::Reader as ImageReader;
|
||||
use std::{fmt, io::Cursor, path::PathBuf};
|
||||
use tokio::{io::AsyncWriteExt, sync::Mutex};
|
||||
use url::Url;
|
||||
|
||||
use crate::{Error, Format, Metadata, CLIENT};
|
||||
|
@ -13,9 +13,9 @@ pub struct Favicon {
|
|||
}
|
||||
|
||||
impl Favicon {
|
||||
pub(crate) fn for_url(url: Url, metadata: Metadata) -> Self {
|
||||
pub(crate) fn for_url<U: reqwest::IntoUrl>(url: U, metadata: Metadata) -> Self {
|
||||
Self {
|
||||
url: Some(url),
|
||||
url: Some(url.into_url().expect("Favicon expects a valid url")),
|
||||
metadata,
|
||||
data: Default::default(),
|
||||
is_url: true,
|
||||
|
@ -141,3 +141,9 @@ impl fmt::Debug for Favicon {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl PartialEq for Favicon {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
self.is_url == other.is_url && self.metadata == other.metadata && self.url == other.url
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue