mirror of
https://github.com/wez/wezterm.git
synced 2024-12-23 05:12:40 +03:00
clippy
This commit is contained in:
parent
d18383416e
commit
df20277d85
1
deps/freetype/regenerate.sh
vendored
1
deps/freetype/regenerate.sh
vendored
@ -7,6 +7,7 @@ bindgen bindings.h -o src/lib.rs \
|
||||
--raw-line "#![allow(non_snake_case)]" \
|
||||
--raw-line "#![allow(non_camel_case_types)]" \
|
||||
--raw-line "#![allow(non_upper_case_globals)]" \
|
||||
--raw-line "#![allow(clippy::unreadable_literal)]" \
|
||||
--raw-line "pub type FT_Int16 = i16;" \
|
||||
--raw-line "pub type FT_UInt16 = u16;" \
|
||||
--raw-line "pub type FT_Int32 = i32;" \
|
||||
|
1
deps/freetype/src/lib.rs
vendored
1
deps/freetype/src/lib.rs
vendored
@ -3,6 +3,7 @@
|
||||
#![allow(non_snake_case)]
|
||||
#![allow(non_camel_case_types)]
|
||||
#![allow(non_upper_case_globals)]
|
||||
#![allow(clippy::unreadable_literal)]
|
||||
pub type FT_Int16 = i16;
|
||||
pub type FT_UInt16 = u16;
|
||||
pub type FT_Int32 = i32;
|
||||
|
1
deps/harfbuzz/regenerate.sh
vendored
1
deps/harfbuzz/regenerate.sh
vendored
@ -6,6 +6,7 @@ bindgen bindings.h -o src/lib.rs \
|
||||
--raw-line "#![allow(non_snake_case)]" \
|
||||
--raw-line "#![allow(non_camel_case_types)]" \
|
||||
--raw-line "#![allow(non_upper_case_globals)]" \
|
||||
--raw-line "#![allow(clippy::unreadable_literal)]" \
|
||||
--default-enum-style rust \
|
||||
--generate=functions,types,vars \
|
||||
--whitelist-function="hb_.*" \
|
||||
|
1
deps/harfbuzz/src/lib.rs
vendored
1
deps/harfbuzz/src/lib.rs
vendored
@ -3,6 +3,7 @@
|
||||
#![allow(non_snake_case)]
|
||||
#![allow(non_camel_case_types)]
|
||||
#![allow(non_upper_case_globals)]
|
||||
#![allow(clippy::unreadable_literal)]
|
||||
|
||||
pub type __int8_t = ::std::os::raw::c_schar;
|
||||
pub type __uint8_t = ::std::os::raw::c_uchar;
|
||||
|
@ -190,6 +190,10 @@ impl Reconnectable {
|
||||
Self { config, stream }
|
||||
}
|
||||
|
||||
// Clippy thinks we should return &ReadAndWrite here, but the caller
|
||||
// needs to know the size of the returned type in a number of situations,
|
||||
// so suppress that lint
|
||||
#[allow(clippy::borrowed_box)]
|
||||
fn stream(&mut self) -> &mut Box<dyn ReadAndWrite> {
|
||||
self.stream.as_mut().unwrap()
|
||||
}
|
||||
|
@ -392,7 +392,7 @@ impl Renderable for RenderableState {
|
||||
let mut inner = self.inner.borrow_mut();
|
||||
let seq = inner.surface.current_seqno();
|
||||
inner.surface.flush_changes_older_than(seq);
|
||||
let selection = inner.selection_range.lock().unwrap().clone();
|
||||
let selection = *inner.selection_range.lock().unwrap();
|
||||
inner.something_changed.store(false, Ordering::SeqCst);
|
||||
inner.local_sequence = seq;
|
||||
inner
|
||||
|
@ -58,7 +58,7 @@ fn emit_column<W: std::io::Write>(
|
||||
/// will be assumed.
|
||||
pub fn tabulate_output<S: std::string::ToString, W: std::io::Write>(
|
||||
columns: &[Column],
|
||||
rows: &Vec<Vec<S>>,
|
||||
rows: &[Vec<S>],
|
||||
output: &mut W,
|
||||
) -> Result<(), std::io::Error> {
|
||||
let mut col_widths: Vec<usize> = columns.iter().map(|c| c.name.len()).collect();
|
||||
@ -83,11 +83,11 @@ pub fn tabulate_output<S: std::string::ToString, W: std::io::Write>(
|
||||
|
||||
emit_column(&col.name, col_widths[idx], col.alignment, output)?;
|
||||
}
|
||||
write!(output, "\n")?;
|
||||
writeln!(output)?;
|
||||
|
||||
for row in &display_rows {
|
||||
for (idx, col) in row.iter().enumerate() {
|
||||
let max_width = col_widths.get(idx).cloned().unwrap_or(col.len());
|
||||
let max_width = col_widths.get(idx).cloned().unwrap_or_else(|| col.len());
|
||||
let alignment = columns
|
||||
.get(idx)
|
||||
.map(|c| c.alignment)
|
||||
@ -99,7 +99,7 @@ pub fn tabulate_output<S: std::string::ToString, W: std::io::Write>(
|
||||
|
||||
emit_column(col, max_width, alignment, output)?;
|
||||
}
|
||||
write!(output, "\n")?;
|
||||
writeln!(output)?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
@ -109,7 +109,7 @@ pub fn tabulate_output<S: std::string::ToString, W: std::io::Write>(
|
||||
/// the formatted data.
|
||||
pub fn tabulate_output_as_string<S: std::string::ToString>(
|
||||
columns: &[Column],
|
||||
rows: &Vec<Vec<S>>,
|
||||
rows: &[Vec<S>],
|
||||
) -> Result<String, std::io::Error> {
|
||||
let mut output: Vec<u8> = vec![];
|
||||
tabulate_output(columns, rows, &mut output)?;
|
||||
|
Loading…
Reference in New Issue
Block a user