mirror of
https://github.com/TECHNOFAB11/tmux-copyrat.git
synced 2025-12-12 16:10:07 +01:00
chore(clippy): fix warnings from nightly
This commit is contained in:
parent
ea8b25c2a7
commit
f08cf307c6
5 changed files with 9 additions and 23 deletions
|
|
@ -24,5 +24,5 @@ fn main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
let Selection { text, .. } = selection.unwrap();
|
let Selection { text, .. } = selection.unwrap();
|
||||||
println!("{}", text);
|
println!("{text}");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ impl Alphabet {
|
||||||
let gen: Vec<String> = letters
|
let gen: Vec<String> = letters
|
||||||
.iter()
|
.iter()
|
||||||
.take(n - lead.len() - prev.len())
|
.take(n - lead.len() - prev.len())
|
||||||
.map(|c| format!("{}{}", prefix, c))
|
.map(|c| format!("{prefix}{c}"))
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
// Insert gen in front of prev
|
// Insert gen in front of prev
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,7 @@ impl FromStr for PaneId {
|
||||||
return Err(Error::ExpectedPaneIdMarker);
|
return Err(Error::ExpectedPaneIdMarker);
|
||||||
}
|
}
|
||||||
let id = src[1..].parse::<u16>()?;
|
let id = src[1..].parse::<u16>()?;
|
||||||
let id = format!("%{}", id);
|
let id = format!("%{id}");
|
||||||
Ok(PaneId(id))
|
Ok(PaneId(id))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -189,7 +189,7 @@ pub fn get_options(prefix: &str) -> Result<HashMap<String, String>> {
|
||||||
let output = duct::cmd!("tmux", "show-options", "-g").read()?;
|
let output = duct::cmd!("tmux", "show-options", "-g").read()?;
|
||||||
let lines: Vec<&str> = output.split('\n').collect();
|
let lines: Vec<&str> = output.split('\n').collect();
|
||||||
|
|
||||||
let pattern = format!(r#"({prefix}[\w\-0-9]+) "?(\w+)"?"#, prefix = prefix);
|
let pattern = format!(r#"({prefix}[\w\-0-9]+) "?(\w+)"?"#);
|
||||||
let re = Regex::new(&pattern).unwrap();
|
let re = Regex::new(&pattern).unwrap();
|
||||||
|
|
||||||
let args: HashMap<String, String> = lines
|
let args: HashMap<String, String> = lines
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ impl tcolor::Color for Color {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn write_fg(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn write_fg(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
match self.0 {
|
match self.0 {
|
||||||
Some(value) => write!(f, "\x1B[38;5;{}m", value),
|
Some(value) => write!(f, "\x1B[38;5;{value}m"),
|
||||||
None => write!(f, "\x1B[39m"),
|
None => write!(f, "\x1B[39m"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -21,7 +21,7 @@ impl tcolor::Color for Color {
|
||||||
#[inline]
|
#[inline]
|
||||||
fn write_bg(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
fn write_bg(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||||
match self.0 {
|
match self.0 {
|
||||||
Some(value) => write!(f, "\x1B[48;5;{}m", value),
|
Some(value) => write!(f, "\x1B[48;5;{value}m"),
|
||||||
None => write!(f, "\x1B[49m"),
|
None => write!(f, "\x1B[49m"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
20
src/ui/vc.rs
20
src/ui/vc.rs
|
|
@ -271,13 +271,7 @@ impl<'a> ViewController<'a> {
|
||||||
None => {
|
None => {
|
||||||
write!(
|
write!(
|
||||||
stdout,
|
stdout,
|
||||||
"{goto}{bg_color}{fg_color}{hint}{fg_reset}{bg_reset}",
|
"{goto}{bg_color}{fg_color}{hint_text}{fg_reset}{bg_reset}",
|
||||||
goto = goto,
|
|
||||||
fg_color = fg_color,
|
|
||||||
bg_color = bg_color,
|
|
||||||
fg_reset = fg_reset,
|
|
||||||
bg_reset = bg_reset,
|
|
||||||
hint = hint_text,
|
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|
@ -330,15 +324,7 @@ impl<'a> ViewController<'a> {
|
||||||
HintStyle::Surround(opening, closing) => {
|
HintStyle::Surround(opening, closing) => {
|
||||||
write!(
|
write!(
|
||||||
stdout,
|
stdout,
|
||||||
"{goto}{bg_color}{fg_color}{bra}{hint}{bra_close}{fg_reset}{bg_reset}",
|
"{goto}{bg_color}{fg_color}{opening}{hint_text}{closing}{fg_reset}{bg_reset}",
|
||||||
goto = goto,
|
|
||||||
fg_color = fg_color,
|
|
||||||
bg_color = bg_color,
|
|
||||||
fg_reset = fg_reset,
|
|
||||||
bg_reset = bg_reset,
|
|
||||||
bra = opening,
|
|
||||||
bra_close = closing,
|
|
||||||
hint = hint_text,
|
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|
@ -531,7 +517,7 @@ impl<'a> ViewController<'a> {
|
||||||
|
|
||||||
event::Key::Char(_ch @ ' ') => {
|
event::Key::Char(_ch @ ' ') => {
|
||||||
output_destination.toggle();
|
output_destination.toggle();
|
||||||
let message = format!("output destination: `{}`", output_destination);
|
let message = format!("output destination: `{output_destination}`");
|
||||||
duct::cmd!("tmux", "display-message", &message)
|
duct::cmd!("tmux", "display-message", &message)
|
||||||
.run()
|
.run()
|
||||||
.expect("could not make tmux display the message.");
|
.expect("could not make tmux display the message.");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue