mirror of https://github.com/hannobraun/Fornjot
Merge pull request #232 from therealprof/clippy-lints
Fix some clippy lints
This commit is contained in:
commit
d1b186b983
|
@ -132,7 +132,7 @@ impl Camera {
|
||||||
&self,
|
&self,
|
||||||
window: &Window,
|
window: &Window,
|
||||||
cursor: Option<PhysicalPosition<f64>>,
|
cursor: Option<PhysicalPosition<f64>>,
|
||||||
triangles: &Vec<Triangle>,
|
triangles: &[Triangle],
|
||||||
) -> FocusPoint {
|
) -> FocusPoint {
|
||||||
let cursor = match cursor {
|
let cursor = match cursor {
|
||||||
Some(cursor) => cursor,
|
Some(cursor) => cursor,
|
||||||
|
|
|
@ -88,7 +88,7 @@ impl ConfigUi {
|
||||||
// - @hannobraun
|
// - @hannobraun
|
||||||
&mut StagingBelt::new(1024),
|
&mut StagingBelt::new(1024),
|
||||||
encoder,
|
encoder,
|
||||||
&view,
|
view,
|
||||||
surface_config.width,
|
surface_config.width,
|
||||||
surface_config.height,
|
surface_config.height,
|
||||||
)?;
|
)?;
|
||||||
|
|
|
@ -87,7 +87,7 @@ impl Pipeline {
|
||||||
front_face: wgpu::FrontFace::Ccw,
|
front_face: wgpu::FrontFace::Ccw,
|
||||||
cull_mode: None,
|
cull_mode: None,
|
||||||
unclipped_depth: false,
|
unclipped_depth: false,
|
||||||
polygon_mode: polygon_mode,
|
polygon_mode,
|
||||||
conservative: false,
|
conservative: false,
|
||||||
},
|
},
|
||||||
depth_stencil: Some(wgpu::DepthStencilState {
|
depth_stencil: Some(wgpu::DepthStencilState {
|
||||||
|
|
|
@ -175,7 +175,6 @@ impl Renderer {
|
||||||
let uniforms = Uniforms {
|
let uniforms = Uniforms {
|
||||||
transform: Transform::for_vertices(camera, aspect_ratio),
|
transform: Transform::for_vertices(camera, aspect_ratio),
|
||||||
transform_normals: Transform::for_normals(camera),
|
transform_normals: Transform::for_normals(camera),
|
||||||
..Uniforms::default()
|
|
||||||
};
|
};
|
||||||
|
|
||||||
self.queue.write_buffer(
|
self.queue.write_buffer(
|
||||||
|
@ -231,7 +230,7 @@ impl Renderer {
|
||||||
&self.geometries.aabb,
|
&self.geometries.aabb,
|
||||||
config,
|
config,
|
||||||
)
|
)
|
||||||
.map_err(|err| DrawError::Text(err))?;
|
.map_err(DrawError::Text)?;
|
||||||
|
|
||||||
let command_buffer = encoder.finish();
|
let command_buffer = encoder.finish();
|
||||||
self.queue.submit(Some(command_buffer));
|
self.queue.submit(Some(command_buffer));
|
||||||
|
@ -261,9 +260,7 @@ impl Renderer {
|
||||||
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
|
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
|
||||||
});
|
});
|
||||||
|
|
||||||
let view = texture.create_view(&wgpu::TextureViewDescriptor::default());
|
texture.create_view(&wgpu::TextureViewDescriptor::default())
|
||||||
|
|
||||||
view
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn clear_views(
|
fn clear_views(
|
||||||
|
|
|
@ -121,7 +121,7 @@ impl Handler {
|
||||||
now: Instant,
|
now: Instant,
|
||||||
camera: &mut Camera,
|
camera: &mut Camera,
|
||||||
window: &Window,
|
window: &Window,
|
||||||
triangles: &Vec<Triangle>,
|
triangles: &[Triangle],
|
||||||
) {
|
) {
|
||||||
let focus_point = camera.focus_point(window, self.cursor, triangles);
|
let focus_point = camera.focus_point(window, self.cursor, triangles);
|
||||||
|
|
||||||
|
|
|
@ -103,7 +103,7 @@ impl Face {
|
||||||
) {
|
) {
|
||||||
match self {
|
match self {
|
||||||
Self::Face { edges, surface } => {
|
Self::Face { edges, surface } => {
|
||||||
let approx = Approximation::for_edges(&edges, tolerance);
|
let approx = Approximation::for_edges(edges, tolerance);
|
||||||
approx.validate().expect("Invalid approximation");
|
approx.validate().expect("Invalid approximation");
|
||||||
|
|
||||||
let points: Vec<_> = approx
|
let points: Vec<_> = approx
|
||||||
|
@ -195,7 +195,7 @@ impl Face {
|
||||||
let intersection = edge
|
let intersection = edge
|
||||||
.to_parry()
|
.to_parry()
|
||||||
.cast_local_ray(&ray, f64::INFINITY, true)
|
.cast_local_ray(&ray, f64::INFINITY, true)
|
||||||
.map(|t| Scalar::from_f64(t));
|
.map(Scalar::from_f64);
|
||||||
|
|
||||||
if let Some(t) = intersection {
|
if let Some(t) = intersection {
|
||||||
// Due to slight inaccuracies, we might get
|
// Due to slight inaccuracies, we might get
|
||||||
|
|
|
@ -41,7 +41,7 @@ fn main() -> anyhow::Result<()> {
|
||||||
|
|
||||||
let mut parameters = HashMap::new();
|
let mut parameters = HashMap::new();
|
||||||
for parameter in args.parameters {
|
for parameter in args.parameters {
|
||||||
let mut parameter = parameter.splitn(2, "=");
|
let mut parameter = parameter.splitn(2, '=');
|
||||||
|
|
||||||
let key = parameter
|
let key = parameter
|
||||||
.next()
|
.next()
|
||||||
|
|
|
@ -123,7 +123,7 @@ impl Ord for Scalar {
|
||||||
fn cmp(&self, other: &Self) -> cmp::Ordering {
|
fn cmp(&self, other: &Self) -> cmp::Ordering {
|
||||||
// Should never panic, as `from_f64` checks that the wrapped value is
|
// Should never panic, as `from_f64` checks that the wrapped value is
|
||||||
// finite.
|
// finite.
|
||||||
self.partial_cmp(&other).unwrap()
|
self.partial_cmp(other).unwrap()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -70,7 +70,7 @@ impl Model {
|
||||||
let shape = unsafe {
|
let shape = unsafe {
|
||||||
let lib = libloading::Library::new(self.lib_path())?;
|
let lib = libloading::Library::new(self.lib_path())?;
|
||||||
let model: libloading::Symbol<ModelFn> = lib.get(b"model")?;
|
let model: libloading::Symbol<ModelFn> = lib.get(b"model")?;
|
||||||
model(&arguments)
|
model(arguments)
|
||||||
};
|
};
|
||||||
|
|
||||||
Ok(shape)
|
Ok(shape)
|
||||||
|
|
Loading…
Reference in New Issue