Rename ThemeVariant to Theme (#3252)

This PR renames the `ThemeVariant` type to `Theme`.

This better reflects its purpose, as well as matches the same name as we
had before, which should make porting crates slightly easier.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2023-11-07 16:41:36 +01:00 committed by GitHub
parent 9cb8512603
commit 74853ea55f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 82 additions and 82 deletions

View file

@ -1,10 +1,10 @@
use crate::{zed_pro_family, ThemeFamily, ThemeVariant};
use crate::{zed_pro_family, Theme, ThemeFamily};
use anyhow::{anyhow, Result};
use gpui::SharedString;
use std::{collections::HashMap, sync::Arc};
pub struct ThemeRegistry {
themes: HashMap<SharedString, Arc<ThemeVariant>>,
themes: HashMap<SharedString, Arc<Theme>>,
}
impl ThemeRegistry {
@ -14,7 +14,7 @@ impl ThemeRegistry {
}
}
fn insert_themes(&mut self, themes: impl IntoIterator<Item = ThemeVariant>) {
fn insert_themes(&mut self, themes: impl IntoIterator<Item = Theme>) {
for theme in themes.into_iter() {
self.themes.insert(theme.name.clone(), Arc::new(theme));
}
@ -28,7 +28,7 @@ impl ThemeRegistry {
self.themes.values().map(|theme| theme.name.clone())
}
pub fn get(&self, name: &str) -> Result<Arc<ThemeVariant>> {
pub fn get(&self, name: &str) -> Result<Arc<Theme>> {
self.themes
.get(name)
.ok_or_else(|| anyhow!("theme not found: {}", name))