fix linting issues and ignore derive docs for tests

This commit is contained in:
alexpasmantier 2024-10-31 14:08:10 +01:00
parent 7045295e12
commit 40f466548b
6 changed files with 22 additions and 27 deletions

View File

@ -33,8 +33,10 @@
- [x] support for images is implemented but do we really want that in the core?
it's quite heavy
- [x] shrink entry names that are too long (from the middle)
- [ ] more syntaxes for the previewer https://www.sublimetext.com/docs/syntax.html#include-syntax
- [ ] more preview colorschemes
## feature ideas
## features
- [x] environment variables
- [x] aliases

View File

@ -110,11 +110,7 @@ impl Channel {
);
let injector = matcher.injector();
let load_handle = tokio::spawn(async move {
let mut lines_in_mem = 0;
for entry in entries {
if lines_in_mem > MAX_LINES_IN_MEM {
break;
}
for entry in entries.into_iter().take(MAX_LINES_IN_MEM) {
injector.push(
CandidateLine::new(
entry.display_name().into(),
@ -125,7 +121,6 @@ impl Channel {
cols[0] = c.line.clone().into();
},
);
lines_in_mem += 1;
}
});

View File

@ -333,14 +333,11 @@ impl Television {
}
}
}
Action::CopyEntryToClipboard => match self.mode {
Mode::Channel => {
Action::CopyEntryToClipboard => if self.mode == Mode::Channel {
if let Some(entry) = self.get_selected_entry(None) {
let mut ctx = ClipboardContext::new().unwrap();
ctx.set_contents(entry.name).unwrap();
}
}
_ => {}
},
Action::ToggleSendToChannel => match self.mode {
Mode::Channel | Mode::RemoteControl => {

View File

@ -30,6 +30,7 @@ pub struct Layout {
}
impl Layout {
#[allow(clippy::too_many_arguments)]
pub fn new(
help_bar_left: Rect,
help_bar_middle: Rect,

View File

@ -98,7 +98,7 @@ impl Television {
let preview_block = self.build_preview_paragraph(
preview_inner_block,
inner,
&preview,
preview,
selected_entry
.line_number
.map(|l| u16::try_from(l).unwrap_or(0)),

View File

@ -4,7 +4,7 @@ use quote::quote;
/// This macro generates a `CliChannel` enum and the necessary glue code
/// to convert into a `TelevisionChannel` member:
///
/// ```rust
/// ```ignore
/// use crate::channels::{TelevisionChannel, OnAir};
/// use television_derive::ToCliChannel;
/// use crate::channels::{files, text};
@ -122,7 +122,7 @@ fn impl_cli_channel(ast: &syn::DeriveInput) -> TokenStream {
/// and forwards the method calls to the corresponding channel variants.
///
/// Example:
/// ```rust
/// ```ignore
/// use television_derive::Broadcast;
/// use crate::channels::{TelevisionChannel, OnAir};
/// use crate::channels::{files, text};