ui: Fix doc tests (#3989)

There were a ton of doc tests that weren't compiling in the `ui` crate,
so this PR fixes them.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-01-09 16:56:28 -05:00 committed by GitHub
parent 68d0b468f3
commit 684bd530f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 63 additions and 53 deletions

View file

@ -16,10 +16,12 @@ pub enum AvatarShape {
/// # Examples
///
/// ```
/// use ui::{Avatar, AvatarShape};
///
/// Avatar::new("path/to/image.png")
/// .shape(AvatarShape::Circle)
/// .grayscale(true)
/// .border_color(cx.theme().colors().border)
/// .border_color(gpui::red());
/// ```
#[derive(IntoElement)]
pub struct Avatar {
@ -87,6 +89,8 @@ impl Avatar {
/// # Examples
///
/// ```
/// use ui::{Avatar, AvatarShape};
///
/// Avatar::new("path/to/image.png").shape(AvatarShape::Circle);
/// ```
pub fn shape(mut self, shape: AvatarShape) -> Self {
@ -102,6 +106,8 @@ impl Avatar {
/// # Examples
///
/// ```
/// use ui::{Avatar, AvatarShape};
///
/// let avatar = Avatar::new("path/to/image.png").grayscale(true);
/// ```
pub fn grayscale(mut self, grayscale: bool) -> Self {