docs and linting

This commit is contained in:
Alexandre Pasmantier 2024-11-05 01:05:26 +01:00
parent ef4154cb4b
commit dff80355d4
6 changed files with 45 additions and 7 deletions

View File

@ -56,12 +56,20 @@ jobs:
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Install Rust toolchain - name: Install Rust toolchain
uses: dtolnay/rust-toolchain@nightly uses: dtolnay/rust-toolchain@nightly
- uses: Swatinem/rust-cache@v2 - name: Configure cache
- name: Check documentation uses: Swatinem/rust-cache@v2
env: - name: Setup pages
RUSTDOCFLAGS: -D warnings id: pages
run: cargo doc --no-deps --document-private-items --all-features --workspace --examples 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 - name: Upload artifact
uses: actions/upload-pages-artifact@v2 uses: actions/upload-pages-artifact@v3
with: with:
path: "target/docs" path: target/doc

View File

@ -87,6 +87,12 @@ pub struct Previewer {
env_var: EnvVarPreviewer, env_var: EnvVarPreviewer,
} }
impl Default for Previewer {
fn default() -> Self {
Previewer::new()
}
}
impl Previewer { impl Previewer {
pub fn new() -> Self { pub fn new() -> Self {
Previewer { Previewer {

View File

@ -5,6 +5,12 @@ use crate::previewers::{Preview, PreviewContent};
pub struct BasicPreviewer {} pub struct BasicPreviewer {}
impl Default for BasicPreviewer {
fn default() -> Self {
BasicPreviewer::new()
}
}
impl BasicPreviewer { impl BasicPreviewer {
pub fn new() -> Self { pub fn new() -> Self {
BasicPreviewer {} BasicPreviewer {}

View File

@ -15,6 +15,12 @@ pub struct DirectoryPreviewer {
cache: Arc<Mutex<PreviewCache>>, cache: Arc<Mutex<PreviewCache>>,
} }
impl Default for DirectoryPreviewer {
fn default() -> Self {
DirectoryPreviewer::new()
}
}
impl DirectoryPreviewer { impl DirectoryPreviewer {
pub fn new() -> Self { pub fn new() -> Self {
DirectoryPreviewer { DirectoryPreviewer {

View File

@ -8,6 +8,12 @@ pub struct EnvVarPreviewer {
cache: HashMap<entry::Entry, Arc<Preview>>, cache: HashMap<entry::Entry, Arc<Preview>>,
} }
impl Default for EnvVarPreviewer {
fn default() -> Self {
EnvVarPreviewer::new()
}
}
impl EnvVarPreviewer { impl EnvVarPreviewer {
pub fn new() -> Self { pub fn new() -> Self {
EnvVarPreviewer { EnvVarPreviewer {

View File

@ -31,6 +31,12 @@ pub struct FilePreviewer {
//image_picker: Arc<Mutex<Picker>>, //image_picker: Arc<Mutex<Picker>>,
} }
impl Default for FilePreviewer {
fn default() -> Self {
FilePreviewer::new()
}
}
impl FilePreviewer { impl FilePreviewer {
pub fn new() -> Self { pub fn new() -> Self {
let syntax_set = SyntaxSet::load_defaults_nonewlines(); let syntax_set = SyntaxSet::load_defaults_nonewlines();