Refactor to remove arrayvec
This commit is contained in:
parent
60cccb3825
commit
fc2c9b77ec
7
Cargo.lock
generated
7
Cargo.lock
generated
|
@ -6,7 +6,6 @@ version = 3
|
|||
name = "KarxOS"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"arrayvec",
|
||||
"bootloader",
|
||||
"lazy_static",
|
||||
"linked_list_allocator",
|
||||
|
@ -17,12 +16,6 @@ dependencies = [
|
|||
"x86_64",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "arrayvec"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "be4dc07131ffa69b8072d35f5007352af944213cde02545e2103680baed38fcd"
|
||||
|
||||
[[package]]
|
||||
name = "bit_field"
|
||||
version = "0.10.1"
|
||||
|
|
|
@ -17,10 +17,6 @@ linked_list_allocator = "0.9.0"
|
|||
version = "1.0"
|
||||
features = ["spin_no_std"]
|
||||
|
||||
[dependencies.arrayvec]
|
||||
version = "0.7.1"
|
||||
default-features = false
|
||||
|
||||
[dependencies.bootloader]
|
||||
version = "0.9.19"
|
||||
features = ["map_physical_memory"]
|
||||
|
|
|
@ -72,11 +72,11 @@ extern "x86-interrupt" fn keyboard_interrupt_handler(_stack_frame: InterruptStac
|
|||
} else if character == '\u{9}' {
|
||||
print!(" ");
|
||||
} else if character == '\n' {
|
||||
use arrayvec::ArrayString;
|
||||
use alloc::string::String;
|
||||
let writer = crate::vga_buffer::WRITER.lock();
|
||||
|
||||
// Gather all chars in the current row into one ArrayString
|
||||
let mut builder = ArrayString::<80>::new();
|
||||
let mut builder = String::new();
|
||||
for character in &writer.buffer.chars[crate::vga_buffer::BUFFER_HEIGHT - 1]
|
||||
{
|
||||
builder.push(character.read().ascii_character as char);
|
||||
|
|
|
@ -2,14 +2,14 @@ use crate::print;
|
|||
use crate::println;
|
||||
use crate::vga_buffer::ScreenChar;
|
||||
use crate::vga_buffer::{change_color, Color};
|
||||
use arrayvec::{ArrayString, ArrayVec};
|
||||
use alloc::{vec::Vec, string::String};
|
||||
|
||||
pub fn evaluate(command: &str) {
|
||||
if let Some(stripped) = command.strip_prefix(">>> ") {
|
||||
let res = stripped.trim();
|
||||
if res != "" {
|
||||
println!();
|
||||
let parts: ArrayVec<&str, 80> = res.split(" ").collect();
|
||||
let parts: Vec<&str> = res.split(" ").collect();
|
||||
let selected = match parts[0] {
|
||||
"help" => help,
|
||||
"info" => info,
|
||||
|
@ -52,7 +52,7 @@ fn info(_arguments: &[&str]) {
|
|||
|
||||
fn echo(arguments: &[&str]) {
|
||||
// Join the arguments back into an ArrayString
|
||||
let mut new: ArrayString<80> = ArrayString::new();
|
||||
let mut new = String::new();
|
||||
for arg in &arguments[1..] {
|
||||
new.push_str(arg);
|
||||
new.push(' ');
|
||||
|
|
Loading…
Reference in a new issue