From 1ef818f58a1d89c302827ddc909a0261100e993a Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Sat, 30 Mar 2019 09:33:33 +0100 Subject: [PATCH] Update to rust 2018 --- Cargo.toml | 1 + src/app/game.rs | 7 +------ src/engine/character/mod.rs | 13 ++++++------- src/engine/map/mod.rs | 6 +++--- src/engine/renderer/mod.rs | 6 +++--- src/engine/scene/mod.rs | 4 ++-- src/lib.rs | 2 -- 7 files changed, 16 insertions(+), 23 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1825e8a..3666b61 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,7 @@ name = "rusty" version = "0.1.0" authors = ["Thomas Forgione "] +edition = "2018" [dependencies] clap = "2.32.0" diff --git a/src/app/game.rs b/src/app/game.rs index 257c331..1d58f11 100644 --- a/src/app/game.rs +++ b/src/app/game.rs @@ -1,11 +1,6 @@ -#[macro_use] -extern crate clap; -extern crate rusty; -extern crate sfml; - use std::time::Instant; -use clap::{App, Arg}; +use clap::{App, Arg, crate_version}; use sfml::window::{joystick, Event, Key}; diff --git a/src/engine/character/mod.rs b/src/engine/character/mod.rs index f37df2a..7e67fef 100644 --- a/src/engine/character/mod.rs +++ b/src/engine/character/mod.rs @@ -4,13 +4,12 @@ use sfml::graphics::{FloatRect, IntRect, View}; use sfml::system::Vector2; use sfml::window::Event; -use engine::controls::{Action, Controls}; -use engine::scene::Updatable; - -use engine::math::{clamp, duration_as_f32, duration_as_frame}; -use engine::physics; -use engine::renderer::Drawable; -use engine::texture::Texture; +use crate::engine::controls::{Action, Controls}; +use crate::engine::scene::Updatable; +use crate::engine::math::{clamp, duration_as_f32, duration_as_frame}; +use crate::engine::physics; +use crate::engine::renderer::Drawable; +use crate::engine::texture::Texture; /// The different sides a character can face. pub enum Side { diff --git a/src/engine/map/mod.rs b/src/engine/map/mod.rs index 6d934af..9f97bf3 100644 --- a/src/engine/map/mod.rs +++ b/src/engine/map/mod.rs @@ -1,9 +1,9 @@ use sfml::graphics::{FloatRect, IntRect}; use sfml::system::Vector2; -use engine::math::{clamp, Matrix}; -use engine::renderer::Drawable; -use engine::texture::Texture; +use crate::engine::math::{clamp, Matrix}; +use crate::engine::renderer::Drawable; +use crate::engine::texture::Texture; /// This enum represents if the collision happens on the X axis or the Y axis. #[derive(Copy, Clone)] diff --git a/src/engine/renderer/mod.rs b/src/engine/renderer/mod.rs index 9e710ba..48e28b8 100644 --- a/src/engine/renderer/mod.rs +++ b/src/engine/renderer/mod.rs @@ -6,9 +6,9 @@ use sfml::window::{Event, Style}; use sfml::system::Vector2; -use engine::map::GraphicTile; -use engine::scene::Scene; -use engine::texture::{Texture, TextureManager}; +use crate::engine::map::GraphicTile; +use crate::engine::scene::Scene; +use crate::engine::texture::{Texture, TextureManager}; /// Our custom drawable trait. pub trait Drawable { diff --git a/src/engine/scene/mod.rs b/src/engine/scene/mod.rs index 9ddba5f..38db964 100644 --- a/src/engine/scene/mod.rs +++ b/src/engine/scene/mod.rs @@ -4,8 +4,8 @@ use sfml::graphics::View; use sfml::system::Vector2; use sfml::window::Event; -use engine::character::Character; -use engine::map::Map; +use crate::engine::character::Character; +use crate::engine::map::Map; /// Contains everything needed to play. pub struct Scene { diff --git a/src/lib.rs b/src/lib.rs index 2df834d..c52d4d2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,7 +2,5 @@ //! This crates contains the (future) rusty game. -extern crate sfml; - /// This module contains all the tools needed for the game. pub mod engine;