This commit is contained in:
Kai Mast 2020-03-28 15:25:55 -07:00
parent 57b2daa57e
commit cbe9298a0b
3 changed files with 8 additions and 9 deletions

View File

@ -54,8 +54,7 @@ impl<'a> Editor<'a> {
if start > 0 {
self.cursor.move_left(self.value);
let _ = self.value.remove(start - 1);
self.value.remove(start - 1);
}
}
}
@ -70,7 +69,7 @@ impl<'a> Editor<'a> {
let end = self.cursor.end(self.value);
if end < self.value.len() {
let _ = self.value.remove(end);
self.value.remove(end);
}
}
}

View File

@ -36,7 +36,7 @@ mod platform {
&self,
future: impl futures::Future<Output = ()> + Send + 'static,
) {
let _ = self.0.spawn(future);
self.0.spawn(future);
}
fn enter<R>(&self, f: impl FnOnce() -> R) -> R {

View File

@ -103,8 +103,8 @@ impl Renderer {
layers.push(Layer::new(Rectangle {
x: 0,
y: 0,
width: u32::from(width),
height: u32::from(height),
width,
height
}));
self.draw_primitive(Vector::new(0.0, 0.0), primitive, &mut layers);
@ -356,7 +356,7 @@ impl Renderer {
) {
let bounds = layer.bounds * scale_factor;
if layer.meshes.len() > 0 {
if !layer.meshes.is_empty() {
let scaled = transformation
* Transformation::scale(scale_factor, scale_factor);
@ -372,7 +372,7 @@ impl Renderer {
);
}
if layer.quads.len() > 0 {
if !layer.quads.is_empty() {
self.quad_pipeline.draw(
device,
encoder,
@ -402,7 +402,7 @@ impl Renderer {
}
}
if layer.text.len() > 0 {
if !layer.text.is_empty() {
for text in layer.text.iter() {
// Target physical coordinates directly to avoid blurry text
let text = wgpu_glyph::Section {