Skip to content

Commit

Permalink
docs and linting
Browse files Browse the repository at this point in the history
  • Loading branch information
alexpasmantier committed Nov 5, 2024
1 parent ef4154c commit dff8035
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 7 deletions.
22 changes: 15 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,20 @@ jobs:
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2
- name: Check documentation
env:
RUSTDOCFLAGS: -D warnings
run: cargo doc --no-deps --document-private-items --all-features --workspace --examples
- name: Configure cache
uses: Swatinem/rust-cache@v2
- name: Setup pages
id: pages
uses: actions/configure-pages@v4
- name: Clean docs folder
run: cargo clean --doc
- name: Build docs
run: cargo doc --no-deps
- name: Add redirect
run: echo '<meta http-equiv="refresh" content="0;url=tv/index.html">' > target/doc/index.html
- name: Remove lock file
run: rm target/doc/.lock
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
uses: actions/upload-pages-artifact@v3
with:
path: "target/docs"
path: target/doc
6 changes: 6 additions & 0 deletions crates/television/previewers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ pub struct Previewer {
env_var: EnvVarPreviewer,
}

impl Default for Previewer {
fn default() -> Self {
Previewer::new()
}
}

impl Previewer {
pub fn new() -> Self {
Previewer {
Expand Down
6 changes: 6 additions & 0 deletions crates/television/previewers/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ use crate::previewers::{Preview, PreviewContent};

pub struct BasicPreviewer {}

impl Default for BasicPreviewer {
fn default() -> Self {
BasicPreviewer::new()
}
}

impl BasicPreviewer {
pub fn new() -> Self {
BasicPreviewer {}
Expand Down
6 changes: 6 additions & 0 deletions crates/television/previewers/directory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ pub struct DirectoryPreviewer {
cache: Arc<Mutex<PreviewCache>>,
}

impl Default for DirectoryPreviewer {
fn default() -> Self {
DirectoryPreviewer::new()
}
}

impl DirectoryPreviewer {
pub fn new() -> Self {
DirectoryPreviewer {
Expand Down
6 changes: 6 additions & 0 deletions crates/television/previewers/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ pub struct EnvVarPreviewer {
cache: HashMap<entry::Entry, Arc<Preview>>,
}

impl Default for EnvVarPreviewer {
fn default() -> Self {
EnvVarPreviewer::new()
}
}

impl EnvVarPreviewer {
pub fn new() -> Self {
EnvVarPreviewer {
Expand Down
6 changes: 6 additions & 0 deletions crates/television/previewers/files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ pub struct FilePreviewer {
//image_picker: Arc<Mutex<Picker>>,
}

impl Default for FilePreviewer {
fn default() -> Self {
FilePreviewer::new()
}
}

impl FilePreviewer {
pub fn new() -> Self {
let syntax_set = SyntaxSet::load_defaults_nonewlines();
Expand Down

0 comments on commit dff8035

Please sign in to comment.