Skip to content

Commit 9534bb7

Browse files
committed
clippy: fix "hiding a lifetime" warnings
from mismatched_lifetime_syntaxes lint
1 parent ac527f9 commit 9534bb7

File tree

19 files changed

+26
-25
lines changed

19 files changed

+26
-25
lines changed

src/uu/chcon/src/chcon.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -794,7 +794,7 @@ enum SELinuxSecurityContext<'t> {
794794
}
795795

796796
impl SELinuxSecurityContext<'_> {
797-
fn to_c_string(&self) -> Result<Option<Cow<CStr>>> {
797+
fn to_c_string(&self) -> Result<Option<Cow<'_, CStr>>> {
798798
match self {
799799
Self::File(context) => context
800800
.to_c_string()

src/uu/chcon/src/fts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ impl FTS {
6161
})
6262
}
6363

64-
pub(crate) fn last_entry_ref(&mut self) -> Option<EntryRef> {
64+
pub(crate) fn last_entry_ref(&mut self) -> Option<EntryRef<'_>> {
6565
self.entry.map(move |entry| EntryRef::new(self, entry))
6666
}
6767

src/uu/csplit/src/csplit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ impl Drop for SplitWriter<'_> {
239239
}
240240

241241
impl SplitWriter<'_> {
242-
fn new(options: &CsplitOptions) -> SplitWriter {
242+
fn new(options: &CsplitOptions) -> SplitWriter<'_> {
243243
SplitWriter {
244244
options,
245245
counter: 0,

src/uu/cut/src/cut.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ fn cut_files(mut filenames: Vec<String>, mode: &Mode) {
404404

405405
/// Get delimiter and output delimiter from `-d`/`--delimiter` and `--output-delimiter` options respectively
406406
/// Allow either delimiter to have a value that is neither UTF-8 nor ASCII to align with GNU behavior
407-
fn get_delimiters(matches: &ArgMatches) -> UResult<(Delimiter, Option<&[u8]>)> {
407+
fn get_delimiters(matches: &ArgMatches) -> UResult<(Delimiter<'_>, Option<&[u8]>)> {
408408
let whitespace_delimited = matches.get_flag(options::WHITESPACE_DELIMITED);
409409
let delim_opt = matches.get_one::<OsString>(options::DELIMITER);
410410
let delim = match delim_opt {

src/uu/od/src/input_decoder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl<I> InputDecoder<'_, I> {
4444
normal_length: usize,
4545
peek_length: usize,
4646
byte_order: ByteOrder,
47-
) -> InputDecoder<I> {
47+
) -> InputDecoder<'_, I> {
4848
let bytes = vec![0; normal_length + peek_length];
4949

5050
InputDecoder {
@@ -64,7 +64,7 @@ where
6464
{
6565
/// calls `peek_read` on the internal stream to (re)fill the buffer. Returns a
6666
/// `MemoryDecoder` providing access to the result or returns an i/o error.
67-
pub fn peek_read(&mut self) -> io::Result<MemoryDecoder> {
67+
pub fn peek_read(&mut self) -> io::Result<MemoryDecoder<'_>> {
6868
match self
6969
.input
7070
.peek_read(self.data.as_mut_slice(), self.reserved_peek_length)

src/uu/od/src/od.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ fn open_input_peek_reader(
603603
input_strings: &[String],
604604
skip_bytes: u64,
605605
read_bytes: Option<u64>,
606-
) -> PeekReader<BufReader<PartialReader<MultifileReader>>> {
606+
) -> PeekReader<BufReader<PartialReader<MultifileReader<'_>>>> {
607607
// should return "impl PeekRead + Read + HasError" when supported in (stable) rust
608608
let inputs = input_strings
609609
.iter()

src/uu/od/src/output_info.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub struct OutputInfo {
4747

4848
impl OutputInfo {
4949
/// Returns an iterator over the `SpacedFormatterItemInfo` vector.
50-
pub fn spaced_formatters_iter(&self) -> Iter<SpacedFormatterItemInfo> {
50+
pub fn spaced_formatters_iter(&self) -> Iter<'_, SpacedFormatterItemInfo> {
5151
self.spaced_formatters.iter()
5252
}
5353

src/uu/runcon/src/runcon.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ fn get_plain_context(context: &OsStr) -> Result<OpaqueSecurityContext> {
282282
.map_err(|r| Error::from_selinux("runcon-operation-creating-context", r))
283283
}
284284

285-
fn get_transition_context(command: &OsStr) -> Result<SecurityContext> {
285+
fn get_transition_context(command: &OsStr) -> Result<SecurityContext<'_>> {
286286
// Generate context based on process transition.
287287
let sec_class = SecurityClass::from_name("process")
288288
.map_err(|r| Error::from_selinux("runcon-operation-getting-process-class", r))?;

src/uu/sort/src/chunks.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,11 @@ impl Chunk {
8888
}
8989
}
9090

91-
pub fn lines(&self) -> &Vec<Line> {
91+
pub fn lines(&self) -> &Vec<Line<'_>> {
9292
&self.borrow_dependent().lines
9393
}
94-
pub fn line_data(&self) -> &LineData {
94+
95+
pub fn line_data(&self) -> &LineData<'_> {
9596
&self.borrow_dependent().line_data
9697
}
9798
}

src/uu/sort/src/merge.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ pub fn merge_with_file_limit<
144144
fn merge_without_limit<M: MergeInput + 'static, F: Iterator<Item = UResult<M>>>(
145145
files: F,
146146
settings: &GlobalSettings,
147-
) -> UResult<FileMerger> {
147+
) -> UResult<FileMerger<'_>> {
148148
let (request_sender, request_receiver) = channel();
149149
let mut reader_files = Vec::with_capacity(files.size_hint().0);
150150
let mut loaded_receivers = Vec::with_capacity(files.size_hint().0);

0 commit comments

Comments
 (0)