From 68469c9afd5337124c6f82d53e3a7593dd600076 Mon Sep 17 00:00:00 2001 From: Jeremy Wall Date: Wed, 30 Oct 2024 13:46:52 -0400 Subject: [PATCH] chore: cleanup unused code and impoorts --- src/ui/mod.rs | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/src/ui/mod.rs b/src/ui/mod.rs index 0916eb5..7bed427 100644 --- a/src/ui/mod.rs +++ b/src/ui/mod.rs @@ -2,7 +2,7 @@ use std::{fs::File, io::Read, path::PathBuf}; -use super::sheet::{Address, CellValue, Tbl}; +use super::sheet::Tbl; use anyhow::{Context, Result}; use ratatui::{ @@ -53,26 +53,6 @@ impl Widget for Workspace { } } -fn generate_default_table<'a>() -> Tbl { - let mut tbl = Tbl::new(); - tbl.update_entry(Address::new(3, 3), CellValue::text("3,3")) - .context("Failed updating entry at 5,5") - .expect("Unexpected fail to update entry"); - tbl.update_entry(Address::new(6, 6), CellValue::float(6.6)) - .context("Failed updating entry at 10,10") - .expect("Unexpected fail to update entry"); - tbl.update_entry(Address::new(0, 0), CellValue::formula("0.0")) - .context("Failed updating entry at 0,0") - .expect("Unexpected fail to update entry"); - tbl.update_entry(Address::new(1, 0), CellValue::formula("1.0")) - .context("Failed updating entry at 0,0") - .expect("Unexpected fail to update entry"); - tbl.update_entry(Address::new(2, 0), CellValue::formula("2.0")) - .context("Failed updating entry at 0,0") - .expect("Unexpected fail to update entry"); - tbl -} - const COLNAMES: [&'static str; 27] = [ "", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", @@ -124,7 +104,6 @@ impl<'t> From<&Tbl> for Table<'t> { } pub fn draw(frame: &mut Frame, name: &PathBuf) { - let table = generate_default_table(); let ws = Workspace::load(name).unwrap(); frame.render_widget(ws, frame.area());