fix clippy issues
This commit is contained in:
@@ -134,7 +134,7 @@ impl TextElement {
|
||||
}
|
||||
}
|
||||
|
||||
bounds.origin = bounds.origin + scroll_offset;
|
||||
bounds.origin += scroll_offset;
|
||||
|
||||
if input.show_cursor(cx) {
|
||||
// cursor blink
|
||||
@@ -268,7 +268,7 @@ impl TextElement {
|
||||
|
||||
// print_points_as_svg_path(&line_corners, &points);
|
||||
|
||||
let first_p = *points.get(0).unwrap();
|
||||
let first_p = *points.first().unwrap();
|
||||
let mut path = gpui::Path::new(bounds.origin + first_p);
|
||||
for p in points.iter().skip(1) {
|
||||
path.line_to(bounds.origin + *p);
|
||||
@@ -295,10 +295,7 @@ impl IntoElement for TextElement {
|
||||
|
||||
/// A debug function to print points as SVG path.
|
||||
#[allow(unused)]
|
||||
fn print_points_as_svg_path(
|
||||
line_corners: &Vec<Corners<Point<Pixels>>>,
|
||||
points: &Vec<Point<Pixels>>,
|
||||
) {
|
||||
fn print_points_as_svg_path(line_corners: &Vec<Corners<Point<Pixels>>>, points: &[Point<Pixels>]) {
|
||||
for corners in line_corners {
|
||||
println!(
|
||||
"tl: ({}, {}), tr: ({}, {}), bl: ({}, {}), br: ({}, {})",
|
||||
@@ -313,7 +310,7 @@ fn print_points_as_svg_path(
|
||||
);
|
||||
}
|
||||
|
||||
if points.len() > 0 {
|
||||
if !points.is_empty() {
|
||||
println!("M{},{}", points[0].x.0 as i32, points[0].y.0 as i32);
|
||||
for p in points.iter().skip(1) {
|
||||
println!("L{},{}", p.x.0 as i32, p.y.0 as i32);
|
||||
|
||||
Reference in New Issue
Block a user