1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-02-12 16:08:38 +00:00

Fix clippy::needless_lifetimes warnings

This commit is contained in:
einfachIrgendwer0815 2025-02-02 14:20:05 +01:00
parent bc24ce9ad4
commit 52252b15d6
No known key found for this signature in database
GPG Key ID: 58D55E5F117DA873
6 changed files with 8 additions and 8 deletions

View File

@ -370,7 +370,7 @@ mod tests {
pub temp_dir: TempDir, pub temp_dir: TempDir,
} }
impl<'a> SyntaxDetectionTest<'a> { impl SyntaxDetectionTest<'_> {
fn new() -> Self { fn new() -> Self {
SyntaxDetectionTest { SyntaxDetectionTest {
assets: HighlightingAssets::from_binary(), assets: HighlightingAssets::from_binary(),

View File

@ -25,7 +25,7 @@ pub struct Controller<'a> {
preprocessor: Option<LessOpenPreprocessor>, preprocessor: Option<LessOpenPreprocessor>,
} }
impl<'b> Controller<'b> { impl Controller<'_> {
pub fn new<'a>(config: &'a Config, assets: &'a HighlightingAssets) -> Controller<'a> { pub fn new<'a>(config: &'a Config, assets: &'a HighlightingAssets) -> Controller<'a> {
Controller { Controller {
config, config,

View File

@ -75,7 +75,7 @@ pub(crate) enum InputKind<'a> {
CustomReader(Box<dyn Read + 'a>), CustomReader(Box<dyn Read + 'a>),
} }
impl<'a> InputKind<'a> { impl InputKind<'_> {
pub fn description(&self) -> InputDescription { pub fn description(&self) -> InputDescription {
match self { match self {
InputKind::OrdinaryFile(ref path) => InputDescription::new(path.to_string_lossy()), InputKind::OrdinaryFile(ref path) => InputDescription::new(path.to_string_lossy()),

View File

@ -73,7 +73,7 @@ pub enum OutputHandle<'a> {
FmtWrite(&'a mut dyn fmt::Write), FmtWrite(&'a mut dyn fmt::Write),
} }
impl<'a> OutputHandle<'a> { impl OutputHandle<'_> {
fn write_fmt(&mut self, args: fmt::Arguments<'_>) -> Result<()> { fn write_fmt(&mut self, args: fmt::Arguments<'_>) -> Result<()> {
match self { match self {
Self::IoWrite(handle) => handle.write_fmt(args).map_err(Into::into), Self::IoWrite(handle) => handle.write_fmt(args).map_err(Into::into),
@ -116,7 +116,7 @@ impl<'a> SimplePrinter<'a> {
} }
} }
impl<'a> Printer for SimplePrinter<'a> { impl Printer for SimplePrinter<'_> {
fn print_header( fn print_header(
&mut self, &mut self,
_handle: &mut OutputHandle, _handle: &mut OutputHandle,
@ -448,7 +448,7 @@ impl<'a> InteractivePrinter<'a> {
} }
} }
impl<'a> Printer for InteractivePrinter<'a> { impl Printer for InteractivePrinter<'_> {
fn print_header( fn print_header(
&mut self, &mut self,
handle: &mut OutputHandle, handle: &mut OutputHandle,

View File

@ -61,7 +61,7 @@ pub struct SyntaxMapping<'a> {
halt_glob_build: Arc<AtomicBool>, halt_glob_build: Arc<AtomicBool>,
} }
impl<'a> Drop for SyntaxMapping<'a> { impl Drop for SyntaxMapping<'_> {
fn drop(&mut self) { fn drop(&mut self) {
// signal the offload thread to halt early // signal the offload thread to halt early
self.halt_glob_build.store(true, Ordering::Relaxed); self.halt_glob_build.store(true, Ordering::Relaxed);

View File

@ -539,7 +539,7 @@ impl<'a> EscapeSequenceOffsetsIterator<'a> {
} }
} }
impl<'a> Iterator for EscapeSequenceOffsetsIterator<'a> { impl Iterator for EscapeSequenceOffsetsIterator<'_> {
type Item = EscapeSequenceOffsets; type Item = EscapeSequenceOffsets;
fn next(&mut self) -> Option<Self::Item> { fn next(&mut self) -> Option<Self::Item> {
match self.chars.peek() { match self.chars.peek() {