diff --git a/.gitignore b/.gitignore index 6ebb03b4..f4f9d423 100755 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ Cargo.lock .vscode/launch.json manual/book/* dependency_order.md +**/nohup.out \ No newline at end of file diff --git a/bracket-bevy/src/builder/bterm_builder.rs b/bracket-bevy/src/builder/bterm_builder.rs index aaf0edec..9b7d43a4 100644 --- a/bracket-bevy/src/builder/bterm_builder.rs +++ b/bracket-bevy/src/builder/bterm_builder.rs @@ -7,7 +7,7 @@ use crate::{ }; use bevy::{ diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagnosticsPlugin}, - prelude::{CoreStage, Plugin, SystemStage, Resource}, + prelude::{CoreStage, Plugin, Resource, SystemStage}, utils::HashMap, }; use bracket_color::prelude::RGBA; diff --git a/bracket-bevy/src/context.rs b/bracket-bevy/src/context.rs index 2722d4ab..19856a05 100644 --- a/bracket-bevy/src/context.rs +++ b/bracket-bevy/src/context.rs @@ -3,7 +3,7 @@ use crate::{ fonts::FontStore, FontCharType, TerminalScalingMode, }; -use bevy::{sprite::Mesh2dHandle, utils::HashMap, prelude::Resource}; +use bevy::{prelude::Resource, sprite::Mesh2dHandle, utils::HashMap}; use bracket_color::prelude::RGBA; use bracket_geometry::prelude::{Point, Rect}; use parking_lot::Mutex; diff --git a/bracket-color/src/color_pair.rs b/bracket-color/src/color_pair.rs index b2cf11ad..502992bc 100755 --- a/bracket-color/src/color_pair.rs +++ b/bracket-color/src/color_pair.rs @@ -16,9 +16,9 @@ impl ColorPair { #[inline] #[must_use] /// Creates a new `ColorPair`, from two given colors. - /// + /// /// # Arguments - /// + /// /// * `fg` - The foreground color to use. /// * `bg` - The background color to use. pub fn new(fg: COLOR, bg: COLOR2) -> Self diff --git a/bracket-color/src/hsv.rs b/bracket-color/src/hsv.rs index 627fe930..9ae0c8bd 100755 --- a/bracket-color/src/hsv.rs +++ b/bracket-color/src/hsv.rs @@ -41,9 +41,9 @@ impl HSV { } /// Constructs a new HSV color, from 3 32-bit floats - /// + /// /// # Arguments - /// + /// /// * `h` - The hue (0..1) to use. /// * `s` - The saturation (0..1) to use. /// * `v` - The value (0..1) to use. @@ -120,14 +120,14 @@ impl HSV { } /// Progress smoothly between two colors, in the HSV color space. - /// + /// /// # Arguments - /// + /// /// * `color` - the target color. /// * `percent` - the percentage (0..1) of the starting (self) and target color to use. - /// + /// /// # Example - /// + /// /// ```rust /// use bracket_color::prelude::*; /// let red = RGB::named(RED); diff --git a/bracket-color/src/lerpit.rs b/bracket-color/src/lerpit.rs index 770e430a..271b7b43 100755 --- a/bracket-color/src/lerpit.rs +++ b/bracket-color/src/lerpit.rs @@ -17,15 +17,15 @@ pub struct RgbLerp { impl RgbLerp { /// Creates a new RGB lerp iterator. The iterator smoothly transitions between two colors, /// using the specified number of steps. - /// + /// /// # Arguments - /// + /// /// * `start` - the color to start from. /// * `end` - the color to end at on the final step. /// * `steps` - number of steps to iterate between the start and end colors. - /// + /// /// # Example - /// + /// /// ```rust /// use bracket_color::prelude::*; /// for color in RgbLerp::new(RGB::named(RED), RGB::named(YELLOW), 20) { diff --git a/bracket-color/src/palette.rs b/bracket-color/src/palette.rs index fef44322..5155fc2f 100755 --- a/bracket-color/src/palette.rs +++ b/bracket-color/src/palette.rs @@ -8,14 +8,14 @@ lazy_static! { } /// Register a palette color by name with the global registry. -/// +/// /// # Arguments -/// +/// /// * `name` - the name of the color to register. /// * `color` - a bracket-lib compatible color to associate with the name. -/// +/// /// # Example -/// +/// /// ```rust /// use bracket_color::prelude::*; /// register_palette_color("red", RED); @@ -27,13 +27,13 @@ pub fn register_palette_color>(name: S, color: CO /// Retrieve a palette color by name from the global registry. /// Returns `Some(RGBA)` if the color is registered, `None` if it is not. -/// +/// /// # Arguments -/// +/// /// * `name` - the requested name. -/// +/// /// # Example -/// +/// /// ```rust /// use bracket_color::prelude::*; /// register_palette_color("red", RED); diff --git a/bracket-color/src/rgb.rs b/bracket-color/src/rgb.rs index 229a5c11..424599ae 100755 --- a/bracket-color/src/rgb.rs +++ b/bracket-color/src/rgb.rs @@ -147,15 +147,15 @@ impl RGB { } /// Constructs a new RGB color, from 3 32-bit floats in the range 0..1 - /// + /// /// # Arguments - /// + /// /// * `r` - the red component (0..1) /// * `g` - the green component (0..1) /// * `b` - the blue component (0..1) - /// + /// /// # Example - /// + /// /// ```rust /// use bracket_color::prelude::*; /// let red = RGB::from_f32(1.0, 0.0, 0.0); @@ -175,15 +175,15 @@ impl RGB { } /// Constructs a new RGB color, from 3 bytes in the range 0..255 - /// + /// /// # Arguments - /// + /// /// * `r` - the red component, ranged from 0 to 255 /// * `g` - the green component, ranged from 0 to 255 /// * `b` - the blue component, ranged from 0 to 255 - /// + /// /// # Example - /// + /// /// ```rust /// use bracket_color::prelude::*; /// let red = RGB::from_u8(255, 0, 0); @@ -200,13 +200,13 @@ impl RGB { } /// Construct an RGB color from a tuple of u8, or a named constant - /// + /// /// # Arguments - /// + /// /// * `col` a tuple of three `u8` values. See `from_u8`. These are usually provided from the `named` colors list. - /// + /// /// # Example - /// + /// /// ```rust /// use bracket_color::prelude::*; /// let red = RGB::named(RED); @@ -219,13 +219,13 @@ impl RGB { } /// Constructs from an HTML color code (e.g. "#eeffee") - /// + /// /// # Arguments - /// + /// /// * `code` - an HTML color notation (e.g. "#ffeeff") - /// + /// /// # Example - /// + /// /// ```rust /// use bracket_color::prelude::*; /// let red = RGB::from_hex("#FF0000"); @@ -233,7 +233,7 @@ impl RGB { /// ``` /// /// # Errors - /// + /// /// See `HtmlColorConversionError` #[allow(clippy::cast_precision_loss)] pub fn from_hex>(code: S) -> Result { diff --git a/bracket-color/src/rgba.rs b/bracket-color/src/rgba.rs index 1247c71e..1bf1a557 100755 --- a/bracket-color/src/rgba.rs +++ b/bracket-color/src/rgba.rs @@ -109,16 +109,16 @@ impl RGBA { } /// Constructs a new RGB color, from 3 32-bit floats in the range 0..1 - /// + /// /// # Arguments - /// + /// /// * `r` - the red component (0..1) /// * `g` - the green component (0..1) /// * `b` - the blue component (0..1) /// * `a` - the alpha component (0..1). 0 is transparent, 1 is solid. - /// + /// /// # Example - /// + /// /// ```rust /// use bracket_color::prelude::*; /// let red = RGBA::from_f32(1.0, 0.0, 0.0, 1.0); @@ -141,15 +141,15 @@ impl RGBA { } /// Constructs a new RGB color, from 3 bytes in the range 0..255 - /// + /// /// # Arguments - /// + /// /// * `r` - the red component, ranged from 0 to 255 /// * `g` - the green component, ranged from 0 to 255 /// * `b` - the blue component, ranged from 0 to 255 - /// + /// /// # Example - /// + /// /// ```rust /// use bracket_color::prelude::*; /// let red = RGBA::from_u8(255, 0, 0, 255); @@ -168,13 +168,13 @@ impl RGBA { } /// Construct an RGB color from a tuple of u8, or a named constant - /// + /// /// # Arguments - /// + /// /// * `col` a tuple of three `u8` values. See `from_u8`. These are usually provided from the `named` colors list. - /// + /// /// # Example - /// + /// /// ```rust /// use bracket_color::prelude::*; /// let red = RGBA::named(RED); @@ -189,11 +189,11 @@ impl RGBA { /// Constructs from an HTML color code (e.g. "#eeffeeff") /// /// # Arguments - /// + /// /// * `code` - an HTML color notation (e.g. "#ffeeffff") - /// + /// /// # Example - /// + /// /// ```rust /// use bracket_color::prelude::*; /// let red = RGBA::from_hex("#FF0000FF"); @@ -201,7 +201,7 @@ impl RGBA { /// ``` /// /// # Errors - /// + /// /// See `HtmlColorConversionError` #[allow(clippy::cast_precision_loss)] pub fn from_hex>(code: S) -> Result { diff --git a/bracket-embedding/src/embedding.rs b/bracket-embedding/src/embedding.rs index 749027cf..0e438a62 100644 --- a/bracket-embedding/src/embedding.rs +++ b/bracket-embedding/src/embedding.rs @@ -3,8 +3,7 @@ use parking_lot::Mutex; use std::collections::HashMap; // These are included by default in `bracket-terminal`. -const TERMINAL_8_8_BYTES: &[u8] = - include_bytes!("../resources/terminal8x8.png"); +const TERMINAL_8_8_BYTES: &[u8] = include_bytes!("../resources/terminal8x8.png"); const TERMINAL_8_16_BYTES: &[u8] = include_bytes!("../resources/vga8x16.png"); lazy_static! { @@ -33,7 +32,7 @@ impl Dictionary { #[must_use] pub fn get_resource(&self, path: String) -> Option<&'static [u8]> { let fixed_path = if std::path::MAIN_SEPARATOR == '/' { - path + path } else { path.replace(std::path::MAIN_SEPARATOR, "/") }; diff --git a/bracket-embedding/src/lib.rs b/bracket-embedding/src/lib.rs index 7f105f98..d514c3d8 100644 --- a/bracket-embedding/src/lib.rs +++ b/bracket-embedding/src/lib.rs @@ -1,20 +1,20 @@ //! The `bracket-embedding` crate is used to provide resource embedding. //! This allows you to include binary assets inside your program when shipping, //! with no external files. This can be especially useful for WASM builds. -//! +//! //! For example: -//! +//! //! ```rust //! use bracket_embedding::prelude::*; -//! +//! //! embedded_resource!(SOURCE_FILE, "embedding.rs"); -//! +//! //! fn main() { //! // This helper macro links the above embedding, allowing it to be accessed as a resource from various parts of the program. //! link_resource!(SOURCE_FILE, "embedding.rs"); //! } //! ``` -//! +//! //! This crate isn't very useful on its own, but is heavily used by the other parts of `bracket-lib`. #![warn(clippy::all, clippy::pedantic, clippy::cargo)] @@ -27,21 +27,21 @@ pub mod prelude { } /// Declare an embedded resource. -/// +/// /// # Arguments -/// +/// /// * `resource_name` - a constant that will represent the resource. /// * `filename` - the path to the file to embed. -/// +/// /// Once embedded, you need to use `link_resource` to make it available. -/// +/// /// # Example -/// +/// /// ```rust /// use bracket_embedding::prelude::*; -/// +/// /// embedded_resource!(SOURCE_FILE, "embedding.rs"); -/// +/// /// fn main() { /// // This helper macro links the above embedding, allowing it to be accessed as a resource from various parts of the program. /// link_resource!(SOURCE_FILE, "embedding.rs"); @@ -56,21 +56,21 @@ macro_rules! embedded_resource { /// Link an embedded resource, making it available to `bracket-lib` via the resources /// system. -/// +/// /// # Arguments -/// +/// /// * `resource_name` - a constant that will represent the resource. /// * `filename` - the path to the file to embed. -/// +/// /// The resource must be previously declared with `embedded_resource!`. -/// +/// /// # Example -/// +/// /// ```rust /// use bracket_embedding::prelude::*; -/// +/// /// embedded_resource!(SOURCE_FILE, "embedding.rs"); -/// +/// /// fn main() { /// // This helper macro links the above embedding, allowing it to be accessed as a resource from various parts of the program. /// link_resource!(SOURCE_FILE, "embedding.rs"); diff --git a/bracket-geometry/src/angle.rs b/bracket-geometry/src/angle.rs index 46604728..f2368421 100755 --- a/bracket-geometry/src/angle.rs +++ b/bracket-geometry/src/angle.rs @@ -12,9 +12,9 @@ pub struct Radians(pub f32); impl Degrees { /// Creates a new angle in degrees. - /// + /// /// # Arguments - /// + /// /// * `angle` - the angle to represent, in degrees. pub fn new(angle: f32) -> Self { Self(angle) @@ -23,9 +23,9 @@ impl Degrees { impl Radians { /// Creates a new angle in radians. - /// + /// /// # Arguments - /// + /// /// * `angle` - the angle to represent, in radians. pub fn new(angle: f32) -> Self { Self(angle) diff --git a/bracket-geometry/src/circle_bresenham.rs b/bracket-geometry/src/circle_bresenham.rs index e11b8e6f..a995c323 100755 --- a/bracket-geometry/src/circle_bresenham.rs +++ b/bracket-geometry/src/circle_bresenham.rs @@ -14,9 +14,9 @@ pub struct BresenhamCircle { impl BresenhamCircle { /// Creates a new circle, using the Bresenham Circle algorithm. - /// + /// /// # Arguments - /// + /// /// * `center` - the center of the circle. /// * `radius` - the radius of the desired circle. #[inline] @@ -83,9 +83,9 @@ pub struct BresenhamCircleNoDiag { impl BresenhamCircleNoDiag { /// Creates a Bresenham Circle without allowing diagonal gaps. - /// + /// /// # Arguments - /// + /// /// * `center` - the center of the circle /// * `radius` - the radius of the circle #[inline] diff --git a/bracket-geometry/src/line_bresenham.rs b/bracket-geometry/src/line_bresenham.rs index 7a5c6a15..7282592f 100755 --- a/bracket-geometry/src/line_bresenham.rs +++ b/bracket-geometry/src/line_bresenham.rs @@ -101,23 +101,23 @@ impl Bresenham { } } - /// Return the next point without checking if we are past `end`. - #[inline] - pub fn advance(&mut self) -> Point { - let p = Point::new(self.x, self.y); - - if self.diff >= 0 { - self.y += 1; - self.diff -= self.dx; - } - - self.diff += self.dy; - - // loop inc - self.x += 1; - - self.octant.from_octant0(p) + /// Return the next point without checking if we are past `end`. + #[inline] + pub fn advance(&mut self) -> Point { + let p = Point::new(self.x, self.y); + + if self.diff >= 0 { + self.y += 1; + self.diff -= self.dx; } + + self.diff += self.dy; + + // loop inc + self.x += 1; + + self.octant.from_octant0(p) + } } impl Iterator for Bresenham { @@ -195,7 +195,7 @@ mod tests { Point::new(2, 2), Point::new(3, 2), Point::new(4, 3), - Point::new(5, 3) + Point::new(5, 3), ]; assert_eq!(res, expected); @@ -218,7 +218,7 @@ mod tests { Point::new(4, 3), Point::new(3, 3), Point::new(2, 2), - Point::new(1, 2) + Point::new(1, 2), ]; assert_eq!(res, expected); diff --git a/bracket-geometry/src/point.rs b/bracket-geometry/src/point.rs index e758cd26..c0318ef9 100755 --- a/bracket-geometry/src/point.rs +++ b/bracket-geometry/src/point.rs @@ -80,9 +80,9 @@ impl Point { } /// Converts the point to a usize tuple - /// + /// /// # Panics - /// + /// /// This can panic if X or Y are not convertible to a `usize`. #[must_use] pub fn to_unsigned_tuple(self) -> (usize, usize) { diff --git a/bracket-pathfinding/examples/astar/common.rs b/bracket-pathfinding/examples/astar/common.rs index 382ee68c..44bfe4ec 100755 --- a/bracket-pathfinding/examples/astar/common.rs +++ b/bracket-pathfinding/examples/astar/common.rs @@ -29,7 +29,7 @@ pub const MAP_WIDTH: usize = 80; pub const MAP_HEIGHT: usize = 20; pub const MAP_TILES: usize = MAP_WIDTH * MAP_HEIGHT; pub const START_POINT: Point = Point::constant(2, 2); -pub const END_POINT: Point = Point::constant(MAP_WIDTH as i32 -2, MAP_HEIGHT as i32 - 2); +pub const END_POINT: Point = Point::constant(MAP_WIDTH as i32 - 2, MAP_HEIGHT as i32 - 2); pub struct Map { pub tiles: Vec, @@ -44,7 +44,7 @@ impl Map { // Add walls for i in 0..15 { tiles.tiles[10 + i * MAP_WIDTH] = '#'; - tiles.tiles[18 + (i+5) * MAP_WIDTH] = '#'; + tiles.tiles[18 + (i + 5) * MAP_WIDTH] = '#'; } tiles diff --git a/bracket-terminal/examples/native_gl.rs b/bracket-terminal/examples/native_gl.rs index b5af4a39..cf07c6f6 100755 --- a/bracket-terminal/examples/native_gl.rs +++ b/bracket-terminal/examples/native_gl.rs @@ -1,7 +1,7 @@ use bracket_terminal::prelude::*; #[cfg(feature = "opengl")] use glow::HasContext; -use glow::{NativeVertexArray, NativeBuffer}; +use glow::{NativeBuffer, NativeVertexArray}; use std::mem; bracket_terminal::add_wasm_support!(); diff --git a/bracket-terminal/src/consoles/command_buffer.rs b/bracket-terminal/src/consoles/command_buffer.rs index 7b59fbed..2ea64c52 100755 --- a/bracket-terminal/src/consoles/command_buffer.rs +++ b/bracket-terminal/src/consoles/command_buffer.rs @@ -868,19 +868,19 @@ pub fn render_draw_buffer(bterm: &mut BTerm) -> BResult<()> { bterm.set(pos.x, pos.y, color.fg, color.bg, *glyph) } DrawCommand::SetBackground { pos, bg } => bterm.set_bg(pos.x, pos.y, *bg), - DrawCommand::Print { pos, text } => bterm.print(pos.x, pos.y, &text), + DrawCommand::Print { pos, text } => bterm.print(pos.x, pos.y, text), DrawCommand::PrintColor { pos, text, color } => { - bterm.print_color(pos.x, pos.y, color.fg, color.bg, &text) + bterm.print_color(pos.x, pos.y, color.fg, color.bg, text) } - DrawCommand::PrintCentered { y, text } => bterm.print_centered(*y, &text), + DrawCommand::PrintCentered { y, text } => bterm.print_centered(*y, text), DrawCommand::PrintColorCentered { y, text, color } => { - bterm.print_color_centered(*y, color.fg, color.bg, &text) + bterm.print_color_centered(*y, color.fg, color.bg, text) } DrawCommand::PrintCenteredAt { pos, text } => { - bterm.print_centered_at(pos.x, pos.y, &text) + bterm.print_centered_at(pos.x, pos.y, text) } DrawCommand::PrintColorCenteredAt { pos, text, color } => { - bterm.print_color_centered_at(pos.x, pos.y, color.fg, color.bg, &text) + bterm.print_color_centered_at(pos.x, pos.y, color.fg, color.bg, text) } DrawCommand::PrintRight { pos, text } => bterm.print_right(pos.x, pos.y, text), DrawCommand::PrintColorRight { pos, text, color } => { diff --git a/bracket-terminal/src/consoles/flexible_console.rs b/bracket-terminal/src/consoles/flexible_console.rs index 76ed3433..e156a2b1 100755 --- a/bracket-terminal/src/consoles/flexible_console.rs +++ b/bracket-terminal/src/consoles/flexible_console.rs @@ -378,7 +378,7 @@ impl Console for FlexiConsole { for c in &self.tiles { let x = c.position.x as usize; let y = c.position.y as usize; - let cell = layer.get_mut(x as usize, y as usize).unwrap(); + let cell = layer.get_mut(x, y).unwrap(); cell.ch = u32::from(c.glyph); cell.fg = XpColor::from(c.fg); cell.bg = XpColor::from(c.bg); diff --git a/bracket-terminal/src/consoles/sparse_console.rs b/bracket-terminal/src/consoles/sparse_console.rs index e6afe949..36cf2b48 100755 --- a/bracket-terminal/src/consoles/sparse_console.rs +++ b/bracket-terminal/src/consoles/sparse_console.rs @@ -341,7 +341,7 @@ impl Console for SparseConsole { for c in &self.tiles { let x = c.idx % self.width as usize; let y = c.idx / self.width as usize; - let cell = layer.get_mut(x as usize, y as usize).unwrap(); + let cell = layer.get_mut(x, y).unwrap(); cell.ch = u32::from(c.glyph); cell.fg = c.fg.into(); cell.bg = c.bg.into(); diff --git a/bracket-terminal/src/consoles/text/format_string.rs b/bracket-terminal/src/consoles/text/format_string.rs index 322fe93d..b2223bf0 100755 --- a/bracket-terminal/src/consoles/text/format_string.rs +++ b/bracket-terminal/src/consoles/text/format_string.rs @@ -7,7 +7,7 @@ pub struct ColoredTextSpans { } fn find_color(col_name: &str) -> RGBA { - if let Some(palette) = palette_color(&col_name) { + if let Some(palette) = palette_color(col_name) { palette } else { RGBA::from_u8(255, 255, 255, 255) diff --git a/bracket-terminal/src/consoles/text/multi_tile_sprite.rs b/bracket-terminal/src/consoles/text/multi_tile_sprite.rs index f8610879..d6fd127e 100755 --- a/bracket-terminal/src/consoles/text/multi_tile_sprite.rs +++ b/bracket-terminal/src/consoles/text/multi_tile_sprite.rs @@ -83,7 +83,7 @@ impl MultiTileSprite { for x in 0..layer.width { let cell = layer.get(x, y).unwrap(); if !cell.bg.is_transparent() { - let idx = (y * (dimensions.x as usize)) + (x as usize); + let idx = (y * (dimensions.x as usize)) + x; tiles[idx].glyph = cell.ch as FontCharType; tiles[idx].fg = cell.fg.into(); tiles[idx].bg = cell.bg.into(); diff --git a/bracket-terminal/src/consoles/text/textblock.rs b/bracket-terminal/src/consoles/text/textblock.rs index 50da22b0..ff6716d4 100755 --- a/bracket-terminal/src/consoles/text/textblock.rs +++ b/bracket-terminal/src/consoles/text/textblock.rs @@ -174,7 +174,7 @@ impl TextBlock { CommandType::TextWrapper { block: t } => { for word in t.split(' ') { - let mut chrs = string_to_cp437(&word); + let mut chrs = string_to_cp437(word); chrs.push(32); if self.cursor.0 + chrs.len() as i32 >= self.width { self.cursor.0 = 0; @@ -225,12 +225,12 @@ impl TextBuilder { } pub fn append(&mut self, text: &str) -> &mut Self { - let chrs = string_to_cp437(&text); + let chrs = string_to_cp437(text); self.commands.push(CommandType::Text { block: chrs }); self } pub fn centered(&mut self, text: &str) -> &mut Self { - let chrs = string_to_cp437(&text); + let chrs = string_to_cp437(text); self.commands.push(CommandType::Centered { block: chrs }); self } diff --git a/bracket-terminal/src/hal/gl_common/backing/shared_main_loop.rs b/bracket-terminal/src/hal/gl_common/backing/shared_main_loop.rs index ced858ee..866d36a7 100755 --- a/bracket-terminal/src/hal/gl_common/backing/shared_main_loop.rs +++ b/bracket-terminal/src/hal/gl_common/backing/shared_main_loop.rs @@ -64,7 +64,7 @@ pub(crate) fn rebuild_consoles() { let cons = &mut bi.consoles[i]; match c { ConsoleBacking::Simple { backing } => { - let mut sc = cons + let sc = cons .console .as_any_mut() .downcast_mut::() @@ -85,7 +85,7 @@ pub(crate) fn rebuild_consoles() { } } ConsoleBacking::Sparse { backing } => { - let mut sc = bi.consoles[i] + let sc = bi.consoles[i] .console .as_any_mut() .downcast_mut::() @@ -106,7 +106,7 @@ pub(crate) fn rebuild_consoles() { } } ConsoleBacking::Fancy { backing } => { - let mut fc = bi.consoles[i] + let fc = bi.consoles[i] .console .as_any_mut() .downcast_mut::() @@ -127,7 +127,7 @@ pub(crate) fn rebuild_consoles() { } } ConsoleBacking::Sprite { backing } => { - let mut sc = bi.consoles[i] + let sc = bi.consoles[i] .console .as_any_mut() .downcast_mut::() @@ -165,8 +165,16 @@ pub(crate) fn render_consoles() -> BResult<()> { backing.gl_draw(font, shader)?; } ConsoleBacking::Sprite { backing } => { - let sprite_sheet = cons.console.as_any().downcast_ref::().unwrap().sprite_sheet; - backing.gl_draw(bi.sprite_sheets[sprite_sheet].backing.as_ref().unwrap(), shader)?; + let sprite_sheet = cons + .console + .as_any() + .downcast_ref::() + .unwrap() + .sprite_sheet; + backing.gl_draw( + bi.sprite_sheets[sprite_sheet].backing.as_ref().unwrap(), + shader, + )?; } } } diff --git a/bracket-terminal/src/hal/gl_common/shader.rs b/bracket-terminal/src/hal/gl_common/shader.rs index 5755a168..51855fb7 100755 --- a/bracket-terminal/src/hal/gl_common/shader.rs +++ b/bracket-terminal/src/hal/gl_common/shader.rs @@ -21,8 +21,8 @@ impl Shader { gl.shader_source(vertex, vertex_code); gl.compile_shader(vertex); if !gl.get_shader_compile_status(vertex) { - log(&vertex_code); - log(&gl.get_shader_info_log(vertex)); + log(vertex_code); + log(gl.get_shader_info_log(vertex)); panic!(); } @@ -31,8 +31,8 @@ impl Shader { gl.shader_source(fragment, fragment_code); gl.compile_shader(fragment); if !gl.get_shader_compile_status(fragment) { - log(&fragment_code); - log(&gl.get_shader_info_log(fragment)); + log(fragment_code); + log(gl.get_shader_info_log(fragment)); panic!(); } @@ -42,7 +42,7 @@ impl Shader { gl.attach_shader(id, fragment); gl.link_program(id); if !gl.get_program_link_status(id) { - log(&gl.get_program_info_log(id)); + log(gl.get_program_info_log(id)); panic!(); } diff --git a/bracket-terminal/src/hal/gl_common/types_native.rs b/bracket-terminal/src/hal/gl_common/types_native.rs index 50dff54d..d01d157a 100755 --- a/bracket-terminal/src/hal/gl_common/types_native.rs +++ b/bracket-terminal/src/hal/gl_common/types_native.rs @@ -1,4 +1,4 @@ -use glow::{NativeTexture, NativeBuffer, NativeVertexArray, NativeProgram, NativeFramebuffer}; +use glow::{NativeBuffer, NativeFramebuffer, NativeProgram, NativeTexture, NativeVertexArray}; pub type TextureId = NativeTexture; pub type BufferId = NativeBuffer; diff --git a/bracket-terminal/src/hal/native/mainloop.rs b/bracket-terminal/src/hal/native/mainloop.rs index f77d39e3..ed80b821 100755 --- a/bracket-terminal/src/hal/native/mainloop.rs +++ b/bracket-terminal/src/hal/native/mainloop.rs @@ -467,7 +467,7 @@ fn tock( } image::save_buffer( - &filename, + filename, &image::imageops::flip_vertical(&img), w, h, diff --git a/bracket-terminal/src/initializer.rs b/bracket-terminal/src/initializer.rs index d3773f7e..9de30566 100755 --- a/bracket-terminal/src/initializer.rs +++ b/bracket-terminal/src/initializer.rs @@ -613,6 +613,6 @@ impl BTermBuilder { fn path_join(a: &str, b: &str) -> String { use std::path::Path; - let path = Path::new(&a).join(&b); + let path = Path::new(&a).join(b); path.to_str().unwrap().to_string() }