Skip to content

Commit c3c85d7

Browse files
committed
Fix clippy errors
1 parent cdd9dc0 commit c3c85d7

File tree

2 files changed

+19
-16
lines changed

2 files changed

+19
-16
lines changed

cli-table-derive/src/utils.rs

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,25 @@ pub fn get_attributes(attrs: &[Attribute]) -> Result<Vec<(Path, Lit)>> {
88
continue;
99
}
1010

11-
if let Err(_) = attribute.parse_nested_meta(|meta| {
12-
let path = meta.path.clone();
13-
let lit = meta
14-
.value()
15-
.ok()
16-
.map(|v| v.parse())
17-
.transpose()?
18-
.unwrap_or(Lit::from(LitBool {
19-
value: true,
20-
span: path.span(),
21-
}));
11+
if attribute
12+
.parse_nested_meta(|meta| {
13+
let path = meta.path.clone();
14+
let lit = meta
15+
.value()
16+
.ok()
17+
.map(|v| v.parse())
18+
.transpose()?
19+
.unwrap_or(Lit::from(LitBool {
20+
value: true,
21+
span: path.span(),
22+
}));
2223

23-
attributes.push((path, lit));
24+
attributes.push((path, lit));
2425

25-
Ok(())
26-
}) {
26+
Ok(())
27+
})
28+
.is_err()
29+
{
2730
return Err(Error::new_spanned(
2831
attribute,
2932
"Attributes should be of type: #[table(key = \"value\", ..)] or #[table(bool)]",

cli-table/src/buffers.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl<'a> Buffers<'a> {
5151
}
5252
}
5353

54-
impl<'a> Write for Buffers<'a> {
54+
impl Write for Buffers<'_> {
5555
fn write(&mut self, buf: &[u8]) -> Result<usize> {
5656
if let Some(ref mut current_buffer) = self.current_buffer {
5757
current_buffer.write(buf)
@@ -73,7 +73,7 @@ impl<'a> Write for Buffers<'a> {
7373
}
7474
}
7575

76-
impl<'a> WriteColor for Buffers<'a> {
76+
impl WriteColor for Buffers<'_> {
7777
fn supports_color(&self) -> bool {
7878
match self.current_buffer {
7979
Some(ref buffer) => buffer.supports_color(),

0 commit comments

Comments
 (0)