Fix up tests

This commit is contained in:
Piotr Osiewicz 2023-11-27 12:33:44 +01:00
parent 4c1514edc4
commit 5cbe8deb50
6 changed files with 21 additions and 13 deletions

View file

@ -1,5 +1,7 @@
use std::sync::Arc;
use crate::prelude::*;
use gpui::{img, ImageSource, Img, IntoElement};
use gpui::{img, ImageData, ImageSource, Img, IntoElement};
#[derive(Debug, Default, PartialEq, Clone)]
pub enum Shape {
@ -34,7 +36,13 @@ impl RenderOnce for Avatar {
}
impl Avatar {
pub fn new(src: impl Into<ImageSource>) -> Self {
pub fn uri(src: impl Into<SharedString>) -> Self {
Self {
src: src.into().into(),
shape: Shape::Circle,
}
}
pub fn data(src: Arc<ImageData>) -> Self {
Self {
src: src.into(),
shape: Shape::Circle,