diff --git a/Cargo.toml b/Cargo.toml index 83b3591..dddea33 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bitsy-parser" -version = "0.72.1" +version = "0.72.2" authors = ["Max Bradbury "] edition = "2018" description = "A parser and utilities for working with Bitsy game data" diff --git a/src/bin/bitsy-dedupe.rs b/src/bin/bitsy-dedupe.rs index 7cb1731..606b986 100644 --- a/src/bin/bitsy-dedupe.rs +++ b/src/bin/bitsy-dedupe.rs @@ -1,4 +1,4 @@ -use bitsy_parser::game::Game; +use bitsy_parser::Game; use std::{env, fs}; const SYNTAX_ERROR: &str = "No game data specified. Usage: `bitsy-dedupe input.bitsy output.bitsy`"; diff --git a/src/bin/bitsy-merge.rs b/src/bin/bitsy-merge.rs index 9ea139f..abda527 100644 --- a/src/bin/bitsy-merge.rs +++ b/src/bin/bitsy-merge.rs @@ -1,4 +1,4 @@ -use bitsy_parser::game::Game; +use bitsy_parser::Game; use std::{env, fs}; const SYNTAX_ERROR: &str = "No main game specified. Usage: `bitsy-merge main.bitsy additional.bitsy output.bitsy`"; diff --git a/src/bin/bitsy-parse.rs b/src/bin/bitsy-parse.rs index a50ceaf..5e00aa6 100644 --- a/src/bin/bitsy-parse.rs +++ b/src/bin/bitsy-parse.rs @@ -1,4 +1,4 @@ -use bitsy_parser::game::Game; +use bitsy_parser::Game; use std::{env, fs}; const SYNTAX_ERROR: &str = "Usage: `bitsy-parse input.bitsy output.bitsy`"; diff --git a/src/bin/bitsy-validate.rs b/src/bin/bitsy-validate.rs index 393c892..7b1079c 100644 --- a/src/bin/bitsy-validate.rs +++ b/src/bin/bitsy-validate.rs @@ -1,4 +1,4 @@ -use bitsy_parser::game::Game; +use bitsy_parser::Game; use std::{env, fs}; const SYNTAX_ERROR: &str = "No input path specified. Usage: `bitsy-validate filepath`"; diff --git a/src/colour.rs b/src/colour.rs index b97b9db..dc3d148 100644 --- a/src/colour.rs +++ b/src/colour.rs @@ -32,7 +32,7 @@ impl ToString for Colour { #[cfg(test)] mod test { - use crate::colour::Colour; + use crate::Colour; #[test] fn colour_from_string() { diff --git a/src/dialogue.rs b/src/dialogue.rs index 07d702a..f8da0a3 100644 --- a/src/dialogue.rs +++ b/src/dialogue.rs @@ -38,7 +38,7 @@ impl ToString for Dialogue { #[cfg(test)] mod test { - use crate::dialogue::Dialogue; + use crate::Dialogue; #[test] fn dialogue_from_string() { diff --git a/src/ending.rs b/src/ending.rs index 046c900..d3f789c 100644 --- a/src/ending.rs +++ b/src/ending.rs @@ -31,7 +31,7 @@ impl fmt::Display for Ending { #[cfg(test)] mod test { - use crate::ending::Ending; + use crate::Ending; use std::str::FromStr; #[test] diff --git a/src/exit.rs b/src/exit.rs index 26801dc..9f1d14d 100644 --- a/src/exit.rs +++ b/src/exit.rs @@ -98,8 +98,7 @@ impl fmt::Display for Exit { #[cfg(test)] mod test { - use crate::exit::{Transition, Exit}; - use crate::position::Position; + use crate::{Transition, Exit, Position}; use std::str::FromStr; #[test] diff --git a/src/game.rs b/src/game.rs index f38d93d..a9b9166 100644 --- a/src/game.rs +++ b/src/game.rs @@ -1,9 +1,10 @@ -use crate::{Dialogue, Ending, Font, Item, Palette, Room, Sprite, TextDirection, Tile, Variable, transform_line_endings, segments_from_string, new_unique_id, try_id, Instance}; +use crate::{Dialogue, Ending, Font, Image, Item, Palette, Room, Sprite, TextDirection, Tile, Variable, transform_line_endings, segments_from_string, new_unique_id, try_id, Instance}; + use loe::TransformMode; + use std::str::FromStr; use std::collections::HashMap; use std::borrow::BorrowMut; -use crate::image::Image; use std::fmt; use std::fmt::Display; @@ -857,10 +858,7 @@ impl Game { #[cfg(test)] mod test { - use crate::game::{Version, Game, NotFound}; - use crate::text::{TextDirection, Font}; - use crate::tile::Tile; - use crate::image::Image; + use crate::{TextDirection, Font, Version, Game, NotFound, Tile, Image}; #[test] fn game_from_string() { diff --git a/src/item.rs b/src/item.rs index d52d99c..2998c44 100644 --- a/src/item.rs +++ b/src/item.rs @@ -77,8 +77,7 @@ impl ToString for Item { #[cfg(test)] mod test { - use crate::item::Item; - use crate::mock; + use crate::{Item, mock}; #[test] fn item_from_string() { diff --git a/src/lib.rs b/src/lib.rs index 78792de..42b944c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,8 @@ extern crate loe; +use std::fmt::Display; use std::io::Cursor; + use radix_fmt::radix_36; use loe::{process, Config, TransformMode}; @@ -20,23 +22,22 @@ pub mod text; pub mod tile; pub mod variable; -// pub mod test_omnibus; +pub mod test_omnibus; -use colour::Colour; -use dialogue::Dialogue; -use ending::Ending; -use exit::{Exit, Transition}; -use game::{Game, Version}; -use image::Image; -use item::Item; -use palette::Palette; -use position::Position; -use room::Room; -use sprite::Sprite; -use std::fmt::Display; -use text::{Font, TextDirection}; -use tile::Tile; -use variable::Variable; +pub use colour::Colour; +pub use dialogue::Dialogue; +pub use ending::Ending; +pub use exit::*; +pub use game::*; +pub use image::Image; +pub use item::Item; +pub use palette::Palette; +pub use position::Position; +pub use room::Room; +pub use sprite::Sprite; +pub use text::*; +pub use tile::Tile; +pub use variable::Variable; #[derive(Clone, Debug, Eq, PartialEq)] pub struct Instance { diff --git a/src/mock.rs b/src/mock.rs index 2c9687d..08d0125 100644 --- a/src/mock.rs +++ b/src/mock.rs @@ -185,8 +185,7 @@ pub fn sprite() -> Sprite { } pub mod item { - use crate::item::Item; - use crate::image::Image; + use crate::{Image, Item}; pub fn key() -> Item { Item { diff --git a/src/palette.rs b/src/palette.rs index 8c9bc08..024f3bd 100644 --- a/src/palette.rs +++ b/src/palette.rs @@ -49,8 +49,7 @@ impl ToString for Palette { #[cfg(test)] mod test { - use crate::colour::Colour; - use crate::palette::Palette; + use crate::{Colour, Palette}; #[test] fn palette_from_string() { diff --git a/src/position.rs b/src/position.rs index 9ebef0b..1e496a0 100644 --- a/src/position.rs +++ b/src/position.rs @@ -38,7 +38,7 @@ impl fmt::Display for Position { #[cfg(test)] mod test { - use crate::position::Position; + use crate::Position; use std::str::FromStr; #[test] diff --git a/src/room.rs b/src/room.rs index a81485d..31d1037 100644 --- a/src/room.rs +++ b/src/room.rs @@ -1,6 +1,14 @@ -use crate::{optional_data_line, Exit, ExitInstance, Instance, Position}; -use crate::game::{RoomType, RoomFormat}; -use crate::exit::Transition; +use crate::{ + optional_data_line, + Exit, + ExitInstance, + Instance, + Position, + RoomType, + RoomFormat, + Transition +}; + use std::str::FromStr; use std::collections::HashMap; @@ -230,8 +238,7 @@ impl Room { #[cfg(test)] mod test { - use crate::room::Room; - use crate::game::{RoomType, RoomFormat}; + use crate::{Room, RoomType, RoomFormat}; #[test] fn room_from_string() { diff --git a/src/sprite.rs b/src/sprite.rs index 347b3c7..14da659 100644 --- a/src/sprite.rs +++ b/src/sprite.rs @@ -128,8 +128,7 @@ impl ToString for Sprite { #[cfg(test)] mod test { - use crate::mock; - use crate::sprite::Sprite; + use crate::{mock, Sprite}; #[test] fn sprite_from_string() { diff --git a/src/tile.rs b/src/tile.rs index c2ee574..fcec446 100644 --- a/src/tile.rs +++ b/src/tile.rs @@ -132,9 +132,7 @@ impl ToString for Tile { #[cfg(test)] mod test { - use crate::tile::Tile; - use crate::image::Image; - use crate::mock; + use crate::{Image, Tile, mock}; #[test] fn tile_from_string() { diff --git a/src/variable.rs b/src/variable.rs index 9a52814..eacc48e 100644 --- a/src/variable.rs +++ b/src/variable.rs @@ -27,7 +27,7 @@ impl ToString for Variable { #[cfg(test)] mod test { - use crate::variable::Variable; + use crate::Variable; #[test] fn variable_from_string() {