From 711287371580fa8b3a835481787361d330fb6a52 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Tue, 17 Mar 2020 20:30:50 +0100 Subject: [PATCH] library: replace `super::super` by `crate` import Done with the following shell command: `sed -e 's/super::super/crate/' -i $(git grep -l super::super)`. Followed by a `cargo fmt --all`. --- src/core/camera.rs | 2 +- src/core/film.rs | 2 +- src/light/ambient_light.rs | 4 ++-- src/light/directional_light.rs | 4 ++-- src/light/point_light.rs | 4 ++-- src/light/spot_light.rs | 4 ++-- src/material/uniform.rs | 4 ++-- src/render/object.rs | 6 +++--- src/shape/sphere.rs | 2 +- src/shape/triangle.rs | 2 +- src/texture/uniform.rs | 4 ++-- 11 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/core/camera.rs b/src/core/camera.rs index ce431e2..264bc80 100644 --- a/src/core/camera.rs +++ b/src/core/camera.rs @@ -1,5 +1,5 @@ -use super::super::{Point, Vector}; use super::film::Film; +use crate::{Point, Vector}; /// Represent an abstract camera to observe the scene. #[derive(Debug, PartialEq)] diff --git a/src/core/film.rs b/src/core/film.rs index 89f7a31..d72fd82 100644 --- a/src/core/film.rs +++ b/src/core/film.rs @@ -1,4 +1,4 @@ -use super::super::{Point, Vector}; +use crate::{Point, Vector}; /// Represent an abstract camera film, to know where each pixel is in space. #[derive(Debug, PartialEq)] diff --git a/src/light/ambient_light.rs b/src/light/ambient_light.rs index e751a87..d76c10c 100644 --- a/src/light/ambient_light.rs +++ b/src/light/ambient_light.rs @@ -1,6 +1,6 @@ -use super::super::core::LinearColor; -use super::super::Point; use super::Light; +use crate::core::LinearColor; +use crate::Point; /// Represent an ambient lighting which is equal in all points of the scene. #[derive(Debug, PartialEq)] diff --git a/src/light/directional_light.rs b/src/light/directional_light.rs index c80a251..9c937d6 100644 --- a/src/light/directional_light.rs +++ b/src/light/directional_light.rs @@ -1,6 +1,6 @@ -use super::super::core::LinearColor; -use super::super::{Point, Vector}; use super::{Light, SpatialLight}; +use crate::core::LinearColor; +use crate::{Point, Vector}; /// Represent a light emanating from a far away source, with parallel rays on all points. #[derive(Debug, PartialEq)] diff --git a/src/light/point_light.rs b/src/light/point_light.rs index 596b026..8d0760b 100644 --- a/src/light/point_light.rs +++ b/src/light/point_light.rs @@ -1,6 +1,6 @@ -use super::super::core::LinearColor; -use super::super::{Point, Vector}; use super::{Light, SpatialLight}; +use crate::core::LinearColor; +use crate::{Point, Vector}; /// Represent a light emanating from a point in space, following the square distance law. #[derive(Debug, PartialEq)] diff --git a/src/light/spot_light.rs b/src/light/spot_light.rs index 170ccce..0bc763f 100644 --- a/src/light/spot_light.rs +++ b/src/light/spot_light.rs @@ -1,6 +1,6 @@ -use super::super::core::LinearColor; -use super::super::{Point, Vector}; use super::{Light, SpatialLight}; +use crate::core::LinearColor; +use crate::{Point, Vector}; /// Represent a light emanating from a directed light-source, outputting rays in a cone. /// The illumination cone cannot have an FOV over 180°. diff --git a/src/material/uniform.rs b/src/material/uniform.rs index b86b43b..63cabef 100644 --- a/src/material/uniform.rs +++ b/src/material/uniform.rs @@ -1,6 +1,6 @@ -use super::super::core::color::LinearColor; -use super::super::Point2D; use super::Material; +use crate::core::color::LinearColor; +use crate::Point2D; /// A material with the same characteristics on all points. #[derive(Debug, PartialEq)] diff --git a/src/render/object.rs b/src/render/object.rs index 56c790e..fc6168c 100644 --- a/src/render/object.rs +++ b/src/render/object.rs @@ -1,6 +1,6 @@ -use super::super::material::Material; -use super::super::shape::Shape; -use super::super::texture::Texture; +use crate::material::Material; +use crate::shape::Shape; +use crate::texture::Texture; /// An object being rendered in the scene. #[derive(Debug)] diff --git a/src/shape/sphere.rs b/src/shape/sphere.rs index 78f07b9..48a5c27 100644 --- a/src/shape/sphere.rs +++ b/src/shape/sphere.rs @@ -1,5 +1,5 @@ -use super::super::{Point, Point2D, Vector}; use super::Shape; +use crate::{Point, Point2D, Vector}; use bvh::aabb::{Bounded, AABB}; use bvh::ray::Ray; diff --git a/src/shape/triangle.rs b/src/shape/triangle.rs index 337a9f9..e91c09a 100644 --- a/src/shape/triangle.rs +++ b/src/shape/triangle.rs @@ -1,5 +1,5 @@ -use super::super::{Point, Point2D, Vector}; use super::Shape; +use crate::{Point, Point2D, Vector}; use bvh::aabb::{Bounded, AABB}; use bvh::ray::Ray; diff --git a/src/texture/uniform.rs b/src/texture/uniform.rs index 0ddff70..a6e1bda 100644 --- a/src/texture/uniform.rs +++ b/src/texture/uniform.rs @@ -1,6 +1,6 @@ -use super::super::core::LinearColor; -use super::super::Point2D; use super::Texture; +use crate::core::LinearColor; +use crate::Point2D; /// A texture with the same color on all points. #[derive(Debug, PartialEq)]