diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 225e7a8..223dce7 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -13,6 +13,7 @@ env: jobs: build: strategy: + fail-fast: true matrix: toolchain: [stable, beta] features: [ @@ -56,7 +57,6 @@ jobs: run: cargo doc --no-deps --package two-face --all-features fuzz: - needs: build runs-on: ubuntu-latest steps: - name: Checkout diff --git a/Cargo.toml b/Cargo.toml index 9cbaa40..228716c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,7 +35,6 @@ keywords = ["syntect", "extra", "syntaxes", "themes"] categories = ["parser-implementations", "text-processing"] description = "Extra syntax and theme definitions for syntect" repository = "https://github.com/CosmicHorrorDev/two-face" -homepage = "https://github.com/CosmicHorrorDev/two-face" [package.metadata.docs.rs] features = ["syntect-default-onig"] diff --git a/README.md b/README.md index 5dd5791..59d809f 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ fn main() { let theme_set = two_face::theme::extra(); let syn_ref = syn_set.find_syntax_by_extension("toml").unwrap(); - let theme = theme_set.get(two_face::theme::EmbeddedThemeName::Nord); + let theme = &theme_set[two_face::theme::EmbeddedThemeName::Nord]; let htmlified = syntect::html::highlighted_html_for_string( TOML_TEXT, &syn_set, diff --git a/src/lib.rs b/src/lib.rs index b089fe3..7c72d51 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -26,7 +26,7 @@ //! let theme_set = two_face::theme::extra(); //! //! let syn_ref = syn_set.find_syntax_by_extension("toml").unwrap(); -//! let theme = theme_set.get(two_face::theme::EmbeddedThemeName::Nord); +//! let theme = &theme_set[two_face::theme::EmbeddedThemeName::Nord]; //! let htmlified = syntect::html::highlighted_html_for_string( //! TOML_TEXT, //! &syn_set, diff --git a/src/theme/mod.rs b/src/theme/mod.rs index 9647f7f..7f44e0f 100644 --- a/src/theme/mod.rs +++ b/src/theme/mod.rs @@ -406,8 +406,9 @@ impl EmbeddedThemeName { /// EmbeddedThemeName::Leet.as_name(), /// "1337", /// ); + /// // `.as_name()` is used for `Display` too! /// assert_eq!( - /// EmbeddedThemeName::SolarizedDark.as_name(), + /// EmbeddedThemeName::SolarizedDark.to_string(), /// "Solarized (dark)", /// ); /// ``` @@ -463,6 +464,19 @@ mod tests { use strum::IntoEnumIterator; + #[test] + fn theme_set_roundtrip() { + let theme_set: ThemeSet = extra().into(); + let lazy: LazyThemeSet = (&theme_set).into(); + let theme_set_again: ThemeSet = lazy.into(); + let eq = theme_set + .themes + .into_iter() + .zip(theme_set_again.themes.into_iter()) + .all(|(pair1, pair2)| pair1 == pair2); + assert!(eq); + } + #[test] fn embedded_theme_is_exhaustive() { let theme_set = extra();