ran cargo fix
This commit is contained in:
+3
-2
@@ -5,13 +5,14 @@
|
||||
#![reexport_test_harness_main = "test_main"]
|
||||
#![feature(abi_x86_interrupt)]
|
||||
#![feature(alloc_error_handler)]
|
||||
#![feature(async_fn_in_trait)]
|
||||
#![feature(async_closure)]
|
||||
#![feature(inherent_associated_types)]
|
||||
#![feature(iter_advance_by)]
|
||||
|
||||
#[cfg(test)]
|
||||
use bootloader::entry_point;
|
||||
|
||||
use bootloader::{entry_point, BootInfo};
|
||||
use bootloader::BootInfo;
|
||||
use core::panic::PanicInfo;
|
||||
extern crate alloc;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ extern "x86-interrupt" fn keyboard_interrupt_handler(_stack_frame: InterruptStac
|
||||
};
|
||||
}
|
||||
|
||||
let keyboard = KEYBOARD.lock();
|
||||
let _keyboard = KEYBOARD.lock();
|
||||
let mut port = Port::new(0x60);
|
||||
let scancode: u8 = unsafe { port.read() };
|
||||
|
||||
|
||||
@@ -269,7 +269,7 @@ impl Renderer {
|
||||
if self.col_pos >= BUFFER_WIDTH {
|
||||
self.internal_newline();
|
||||
}
|
||||
let row = BUFFER_HEIGHT - 1;
|
||||
let _row = BUFFER_HEIGHT - 1;
|
||||
let col = self.col_pos;
|
||||
|
||||
let buff_len = self.term_buffer.len();
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
use cmos_rtc::Time;
|
||||
|
||||
use crate::println;
|
||||
use super::super::kernel::interrupts::GLOBALTIMER;
|
||||
use x86_64::instructions::interrupts;
|
||||
use crate::system::kernel::interrupts::InterruptIndex;
|
||||
|
||||
|
||||
pub fn wait(seconds: f64) {
|
||||
let mut start = 0;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use crate::{serial_println, std};
|
||||
use crate::std::application::{self, Application};
|
||||
use crate::std::io::{Color, ColorCode, Display, KeyStroke, Screen};
|
||||
use crate::std::io::{Color, ColorCode, Display, KeyStroke};
|
||||
use crate::std::render::{ColouredChar, Frame, Position, RenderError};
|
||||
use crate::user::lib::libgui::cg_core::CgComponent;
|
||||
|
||||
@@ -169,7 +169,7 @@ impl Application for Editor {
|
||||
}
|
||||
}
|
||||
|
||||
async fn run(&mut self, args: Vec<String>) -> Result<(), application::Error> {
|
||||
async fn run(&mut self, _args: Vec<String>) -> Result<(), application::Error> {
|
||||
|
||||
// if let Some(s) = args.get(0) {
|
||||
// self.buffer = s.lines().map(|l| l.chars().collect()).collect::<Vec<Vec<char>>>()
|
||||
|
||||
@@ -6,7 +6,7 @@ use core::any::Any;
|
||||
use async_trait::async_trait;
|
||||
use crate::std::application::{Application, Error};
|
||||
use crate::std::render::{Frame, Position, Dimensions, ColouredChar, RenderError};
|
||||
use crate::std::io::{Display, KeyStroke, Screen, Stdin};
|
||||
use crate::std::io::{Display, KeyStroke, Stdin};
|
||||
|
||||
use crate::user::lib::libgui::{
|
||||
cg_core::{CgComponent},
|
||||
@@ -22,7 +22,7 @@ const OFFSET_Y: i64 = 10;
|
||||
|
||||
use core::f64::consts::E;
|
||||
use core::f64::consts::PI;
|
||||
use crate::serial_println;
|
||||
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Grapher {
|
||||
@@ -50,7 +50,7 @@ impl Application for Grapher {
|
||||
}
|
||||
}
|
||||
async fn run(&mut self, args: Vec<String>) -> Result<(), Error> {
|
||||
let d = Display::borrow();
|
||||
let _d = Display::borrow();
|
||||
|
||||
self.frame.frame = vec![vec![ColouredChar::new(' '); self.frame.dimensions.x]; self.frame.dimensions.y];
|
||||
|
||||
@@ -138,10 +138,10 @@ impl Application for Grapher {
|
||||
if let Ok(frame) = container.render() {
|
||||
|
||||
let self_widget = container.elements.get("grapher").unwrap();
|
||||
let self_clone = self_widget.fetch::<Grapher>().unwrap();
|
||||
let _self_clone = self_widget.fetch::<Grapher>().unwrap();
|
||||
|
||||
let entry = container.elements.get("entry_box").unwrap();
|
||||
let entry_clone = entry.fetch::<CgLineEdit>().unwrap();
|
||||
let _entry_clone = entry.fetch::<CgLineEdit>().unwrap();
|
||||
|
||||
frame.write_to_screen().map_err(|_| Error::ApplicationError(String::from("failed to write to screen")))?;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use hashbrown::HashMap;
|
||||
|
||||
use crate::user::lib::geometry::Position;
|
||||
|
||||
|
||||
use super::{map::Map, player::Player};
|
||||
|
||||
pub struct Game {
|
||||
|
||||
@@ -21,9 +21,9 @@ impl Application for GameOfLife {
|
||||
frame: Frame::new(Position::new(0, 0), Dimensions::new(80, 25)).unwrap()
|
||||
}
|
||||
}
|
||||
async fn run(&mut self, args: Vec<String>) -> Result<(), Error> {
|
||||
async fn run(&mut self, _args: Vec<String>) -> Result<(), Error> {
|
||||
// setup:
|
||||
let d = Display::borrow();
|
||||
let _d = Display::borrow();
|
||||
|
||||
let xoffset = 38;
|
||||
let yoffset = 5;
|
||||
@@ -78,7 +78,7 @@ impl GameOfLife {
|
||||
|
||||
let mut frame = Frame::new(Position::new(0, 0), Dimensions::new(80, 25)).unwrap();
|
||||
|
||||
self.frame.frame.iter().enumerate().for_each(|(y, row)| row.iter().enumerate().for_each(|(x, chr)| {
|
||||
self.frame.frame.iter().enumerate().for_each(|(y, row)| row.iter().enumerate().for_each(|(x, _chr)| {
|
||||
frame[y][x] = self.get_new_value(x as u8, y as u8);
|
||||
}));
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ impl Application for Game {
|
||||
|
||||
async fn run(&mut self, args: Vec<String>) -> Result<(), Error> {
|
||||
|
||||
let settings = [0, 0, 0]; // ai_count, snake_len, poi_count
|
||||
let _settings = [0, 0, 0]; // ai_count, snake_len, poi_count
|
||||
|
||||
if args.len() == 0 {
|
||||
self.gamemode = Gamemode::SinglePlayer;
|
||||
@@ -75,7 +75,7 @@ impl Application for Game {
|
||||
self.prepare();
|
||||
|
||||
// switch OS to application mode
|
||||
let d = Display::borrow();
|
||||
let _d = Display::borrow();
|
||||
// render the initial state of the screen.
|
||||
self.render().map_err(|_| Error::ApplicationError(String::from("failed to render game screen")))?;
|
||||
// run the game
|
||||
@@ -99,19 +99,19 @@ impl Game {
|
||||
}
|
||||
|
||||
fn respawn_snakes(&mut self) {
|
||||
if let Gamemode::WithAI(ai_count, snake_len, _poi) = self.gamemode {
|
||||
if let Gamemode::WithAI(_ai_count, snake_len, _poi) = self.gamemode {
|
||||
self.snakes.push(Snake::ai(self.snakes.len() + 1, snake_len));
|
||||
}
|
||||
}
|
||||
|
||||
async fn gameloop(&mut self) -> Result<(), Error> { // main gameloop
|
||||
let mut all_points: Vec<Position>;
|
||||
let mut _all_points: Vec<Position>;
|
||||
|
||||
'gameloop: loop {
|
||||
|
||||
time::wait(0.1);
|
||||
|
||||
let mut points: Vec<Position>;
|
||||
let mut _points: Vec<Position>;
|
||||
let length = self.snakes.len();
|
||||
|
||||
for i in 0..length {
|
||||
@@ -350,7 +350,7 @@ impl PathFinder {
|
||||
}
|
||||
}
|
||||
|
||||
fn optimal_move(head: &Position, rel_pos: &Position, moves: &Vec<Direction>) -> Direction {
|
||||
fn optimal_move(_head: &Position, rel_pos: &Position, moves: &Vec<Direction>) -> Direction {
|
||||
let mut optimal_moves = vec![Direction::None; 4];
|
||||
|
||||
let x_offset: usize;
|
||||
|
||||
@@ -2,13 +2,11 @@
|
||||
use lazy_static::lazy_static;
|
||||
use spin::Mutex;
|
||||
use vga::{
|
||||
writers::{PrimitiveDrawing, GraphicsWriter, Graphics640x480x16},
|
||||
colors::Color16,
|
||||
writers::{PrimitiveDrawing, GraphicsWriter},
|
||||
};
|
||||
|
||||
// Standard library
|
||||
use alloc::{
|
||||
boxed::Box,
|
||||
format,
|
||||
string::{String, ToString},
|
||||
vec,
|
||||
@@ -21,7 +19,7 @@ use crate::{
|
||||
println,
|
||||
std::{
|
||||
application::{Application, Error, Exit},
|
||||
time::{timer, wait},
|
||||
time::{timer},
|
||||
io::{Color, write, Screen, Stdin, Serial, KeyStroke, Display},
|
||||
},
|
||||
user::{
|
||||
@@ -212,7 +210,7 @@ async fn exec() -> Result<(), Error> {
|
||||
timer();
|
||||
}
|
||||
"test_features" => {
|
||||
let d = Display::borrow();
|
||||
let _d = Display::borrow();
|
||||
setup_ui().await;
|
||||
}
|
||||
_ => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use alloc::borrow::ToOwned;
|
||||
use alloc::vec::Vec;
|
||||
use libm::sqrt;
|
||||
use crate::println;
|
||||
|
||||
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub enum Line {
|
||||
|
||||
@@ -521,7 +521,7 @@ impl CgComponent for CgDialog {
|
||||
|
||||
#[async_trait]
|
||||
impl CgKeyboardCapture for CgDialog {
|
||||
async fn keyboard_capture(&mut self, break_condition: fn(KeyStroke) -> (KeyStroke, Exit), app: Option<&Widget>) -> Result<(Exit, usize), RenderError> {
|
||||
async fn keyboard_capture(&mut self, break_condition: fn(KeyStroke) -> (KeyStroke, Exit), _app: Option<&Widget>) -> Result<(Exit, usize), RenderError> {
|
||||
loop {
|
||||
let k = break_condition(Stdin::keystroke().await);
|
||||
match k {
|
||||
|
||||
Reference in New Issue
Block a user