1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-23 05:12:40 +03:00
This commit is contained in:
Wez Furlong 2019-07-06 08:13:22 -07:00
parent d18383416e
commit df20277d85
7 changed files with 14 additions and 6 deletions

View File

@ -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;" \

View File

@ -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;

View File

@ -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_.*" \

View File

@ -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;

View File

@ -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()
}

View File

@ -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

View File

@ -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)?;