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