mirror of
https://github.com/alexpasmantier/television.git
synced 2025-06-07 12:05:34 +00:00
fix linting issues and ignore derive docs for tests
This commit is contained in:
parent
7045295e12
commit
40f466548b
4
TODO.md
4
TODO.md
@ -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
|
||||
|
@ -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;
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -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 => {
|
||||
|
@ -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,
|
||||
|
@ -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)),
|
||||
|
@ -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};
|
||||
|
Loading…
x
Reference in New Issue
Block a user