clippy
This commit is contained in:
1 parent
3750337b30
commit
f493139305
10 files changed
+23
-18
No files matched your search
+2
-2
@@ -623,8 +623,8 @@ fn default_hyperlink_rules() -> Vec<hyperlink::Rule> {
|
||||
|
||||
fn default_harfbuzz_features() -> Vec<String> {
|
||||
["kern", "liga", "clig"]
|
||||
.into_iter()
|
||||
.map(|s| s.to_string())
|
||||
.iter()
|
||||
.map(|&s| s.to_string())
|
||||
.collect()
|
||||
}
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ pub fn compute_load_flags_from_config() -> i32 {
|
||||
// If the bitmaps are in color, we want those!
|
||||
let flags = flags | FT_LOAD_COLOR;
|
||||
|
||||
#[allow(clippy::let_and_return)]
|
||||
let flags = if config.font_antialias == FontAntiAliasing::None {
|
||||
// When AA is disabled, force outline rendering to monochrome
|
||||
flags | FT_LOAD_MONOCHROME
|
||||
|
||||
@@ -117,7 +117,7 @@ impl FontLocatorSelection {
|
||||
#[cfg(not(any(target_os = "macos", windows)))]
|
||||
panic!("fontkit not compiled in");
|
||||
}
|
||||
Self::ConfigDirsOnly => return Box::new(NopSystemSource {}),
|
||||
Self::ConfigDirsOnly => Box::new(NopSystemSource {}),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ impl TabBarState {
|
||||
|
||||
line.set_cell(x, Cell::new(' ', cell_attrs.clone()));
|
||||
line.set_cell(x + 1, Cell::new('+', cell_attrs.clone()));
|
||||
line.set_cell(x + 2, Cell::new(' ', cell_attrs.clone()));
|
||||
line.set_cell(x + 2, Cell::new(' ', cell_attrs));
|
||||
x += 3;
|
||||
}
|
||||
|
||||
|
||||
+5
-7
@@ -16,15 +16,13 @@ pub trait TerminalConfiguration: std::fmt::Debug {
|
||||
|
||||
// TODO: expose is_double_click_word in config file
|
||||
fn is_double_click_word(&self, s: &str) -> bool {
|
||||
if s.len() > 1 {
|
||||
true
|
||||
} else if s.len() == 1 {
|
||||
match s.chars().nth(0).unwrap() {
|
||||
match s.len() {
|
||||
1 => match s.chars().nth(0).unwrap() {
|
||||
' ' | '\t' | '\n' | '{' | '[' | '}' | ']' | '(' | ')' | '"' | '\'' => false,
|
||||
_ => true,
|
||||
}
|
||||
} else {
|
||||
false
|
||||
},
|
||||
0 => false,
|
||||
_ => true,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -385,7 +385,7 @@ impl Line {
|
||||
|
||||
if num_trailing_spaces > 0 {
|
||||
if !left.is_empty() {
|
||||
result.push(Change::Text(left.to_string()));
|
||||
result.push(Change::Text(left));
|
||||
} else if result.len() == 1 {
|
||||
// if the only queued result prior to clearing
|
||||
// to the end of the line is an attribute change,
|
||||
@@ -405,10 +405,10 @@ impl Line {
|
||||
result.push(Change::ClearToEndOfLine(attr.background));
|
||||
}
|
||||
} else {
|
||||
result.push(Change::Text(text_run.clone()));
|
||||
result.push(Change::Text(text_run));
|
||||
}
|
||||
} else {
|
||||
result.push(Change::Text(text_run.clone()));
|
||||
result.push(Change::Text(text_run));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -332,7 +332,7 @@ impl LayoutState {
|
||||
)
|
||||
.map_err(adderr)?;
|
||||
self.solver
|
||||
.add_constraint(state.left | GE(REQUIRED) | parent_left.clone())
|
||||
.add_constraint(state.left | GE(REQUIRED) | parent_left)
|
||||
.map_err(adderr)?;
|
||||
|
||||
self.solver
|
||||
@@ -341,7 +341,7 @@ impl LayoutState {
|
||||
)
|
||||
.map_err(adderr)?;
|
||||
self.solver
|
||||
.add_constraint(state.top | GE(REQUIRED) | parent_top.clone())
|
||||
.add_constraint(state.top | GE(REQUIRED) | parent_top)
|
||||
.map_err(adderr)?;
|
||||
|
||||
if is_root_widget {
|
||||
|
||||
@@ -170,9 +170,15 @@ mod avx {
|
||||
/// storage filled in by the trait implementation.
|
||||
pub trait BitmapImage {
|
||||
/// Obtain a read only pointer to the pixel data
|
||||
/// # Safety
|
||||
/// The caller is responsible for ensuring that pixel
|
||||
/// access is bounded by the image_dimensions
|
||||
unsafe fn pixel_data(&self) -> *const u8;
|
||||
|
||||
/// Obtain a mutable pointer to the pixel data
|
||||
/// # Safety
|
||||
/// The caller is responsible for ensuring that pixel
|
||||
/// access is bounded by the image_dimensions
|
||||
unsafe fn pixel_data_mut(&mut self) -> *mut u8;
|
||||
|
||||
/// Return the pair (width, height) of the image, measured in pixels
|
||||
|
||||
@@ -287,7 +287,7 @@ impl WaylandWindowInner {
|
||||
// Avoid redundant key == raw_key
|
||||
let (key, raw_key) = match (key, raw_key) {
|
||||
// Avoid eg: \x01 when we can use CTRL-A
|
||||
(KeyCode::Char(c), Some(raw)) if c.is_ascii_control() => (raw.clone(), None),
|
||||
(KeyCode::Char(c), Some(raw)) if c.is_ascii_control() => (raw, None),
|
||||
(key, Some(raw)) if key == raw => (key, None),
|
||||
pair => pair,
|
||||
};
|
||||
|
||||
@@ -690,7 +690,7 @@ impl XWindow {
|
||||
|
||||
window.lock().unwrap().callbacks.created(&window_handle);
|
||||
|
||||
conn.windows.borrow_mut().insert(window_id, window.clone());
|
||||
conn.windows.borrow_mut().insert(window_id, window);
|
||||
|
||||
window_handle.set_title(name);
|
||||
window_handle.show();
|
||||
|
||||
Reference in new issue
Block a user