cargo fix

This commit is contained in:
Michael Sippel 2023-09-06 23:40:32 +02:00
parent 84b2a6e66d
commit e22f4cc9ac
Signed by: senvas
GPG key ID: F96CF119C34B64A6
7 changed files with 30 additions and 34 deletions

View file

@ -1,6 +1,6 @@
use { use {
r3vi::{ r3vi::{
view::{ChannelSender, ChannelReceiver, port::UpdateTask, OuterViewPort, singleton::*, sequence::*}, view::{OuterViewPort, singleton::*, sequence::*},
buffer::{singleton::*, vec::*} buffer::{singleton::*, vec::*}
}, },
crate::{ crate::{
@ -10,8 +10,7 @@ use {
diagnostics::Diagnostics, diagnostics::Diagnostics,
commander::ObjCommander commander::ObjCommander
}, },
std::sync::{Arc, RwLock, Mutex}, std::sync::{Arc, RwLock}
std::ops::Deref
}; };
//<<<<>>>><<>><><<>><<<*>>><<>><><<>><<<<>>>> //<<<<>>>><<>><><<>><<<*>>><<>><><<>><<<<>>>>

View file

@ -248,7 +248,7 @@ impl TreeNav for ListEditor {
let cur_item = self.data.get(cur.tree_addr[0] as usize); let cur_item = self.data.get(cur.tree_addr[0] as usize);
let cur_height = cur_item.read().unwrap().get_height(&TreeHeightOp::Max); let cur_height = cur_item.read().unwrap().get_height(&TreeHeightOp::Max);
let mut new_item = self.data let new_item = self.data
.get_mut(idx as usize); .get_mut(idx as usize);
let height = new_item.read().unwrap().get_height( let height = new_item.read().unwrap().get_height(
@ -356,7 +356,7 @@ impl TreeNav for ListEditor {
let pxv_height = pxv_item.read().unwrap().get_height(&TreeHeightOp::Q) as isize; let pxv_height = pxv_item.read().unwrap().get_height(&TreeHeightOp::Q) as isize;
let cur_height = cur_item.read().unwrap().get_height(&TreeHeightOp::P) as isize; let cur_height = cur_item.read().unwrap().get_height(&TreeHeightOp::P) as isize;
let dist_from_ground = (cur_height - (depth as isize - 1)); let dist_from_ground = cur_height - (depth as isize - 1);
let n_steps_down = let n_steps_down =
if gravity { if gravity {
pxv_height - dist_from_ground pxv_height - dist_from_ground
@ -366,7 +366,7 @@ impl TreeNav for ListEditor {
eprintln!("<- LEFT CROSS: pxv_height = {}, cur_height = {}, dist_from_ground = {}, n_steps_down = {}", pxv_height, cur_height, dist_from_ground, n_steps_down); eprintln!("<- LEFT CROSS: pxv_height = {}, cur_height = {}, dist_from_ground = {}, n_steps_down = {}", pxv_height, cur_height, dist_from_ground, n_steps_down);
new_addr.push( cur.tree_addr[0] - 1 ); new_addr.push( cur.tree_addr[0] - 1 );
for i in 0..n_steps_down { for _i in 0..n_steps_down {
new_addr.push( -1 ); new_addr.push( -1 );
} }
@ -376,7 +376,7 @@ impl TreeNav for ListEditor {
let cur_height = cur_item.read().unwrap().get_height(&TreeHeightOp::Q) as isize; let cur_height = cur_item.read().unwrap().get_height(&TreeHeightOp::Q) as isize;
let nxd_height = nxd_item.read().unwrap().get_height(&TreeHeightOp::P) as isize; let nxd_height = nxd_item.read().unwrap().get_height(&TreeHeightOp::P) as isize;
let dist_from_ground = (cur_height - (depth as isize - 1)); let dist_from_ground = cur_height - (depth as isize - 1);
let n_steps_down = let n_steps_down =
if gravity { if gravity {
nxd_height - dist_from_ground nxd_height - dist_from_ground
@ -386,7 +386,7 @@ impl TreeNav for ListEditor {
eprintln!("-> RIGHT CROSS: cur_height = {}, nxd_height = {}, dist_from_ground = {}, n_steps_down = {}", cur_height, nxd_height, dist_from_ground, n_steps_down); eprintln!("-> RIGHT CROSS: cur_height = {}, nxd_height = {}, dist_from_ground = {}, n_steps_down = {}", cur_height, nxd_height, dist_from_ground, n_steps_down);
new_addr.push( cur.tree_addr[0] + 1 ); new_addr.push( cur.tree_addr[0] + 1 );
for i in 0..n_steps_down { for _i in 0..n_steps_down {
new_addr.push( 0 ); new_addr.push( 0 );
} }
} }

View file

@ -1,23 +1,21 @@
use { use {
r3vi::{ r3vi::{
buffer::{singleton::*, vec::*}, view::{singleton::*, sequence::*}
view::{singleton::*, sequence::*, OuterViewPort}
}, },
crate::{ crate::{
type_system::{Context, TypeID, TypeTerm, ReprTree}, type_system::{ReprTree},
editors::{list::{ListCursorMode, ListEditor, ListCmd}}, editors::{list::{ListEditor, ListCmd}},
tree::{NestedNode, TreeNav, TreeNavResult, TreeCursor}, tree::{NestedNode, TreeNav, TreeNavResult, TreeCursor},
commander::ObjCommander commander::ObjCommander
}, },
std::{sync::{Arc, RwLock, Mutex}, any::Any}, std::{sync::{Arc, RwLock}},
cgmath::{Vector2},
super::{TypeTermEditor, State} super::{TypeTermEditor, State}
}; };
impl ObjCommander for TypeTermEditor { impl ObjCommander for TypeTermEditor {
fn send_cmd_obj(&mut self, co: Arc<RwLock<ReprTree>>) -> TreeNavResult { fn send_cmd_obj(&mut self, co: Arc<RwLock<ReprTree>>) -> TreeNavResult {
let cur = self.get_cursor(); let _cur = self.get_cursor();
let cmd_obj = co.clone(); let cmd_obj = co.clone();
let cmd_obj = cmd_obj.read().unwrap(); let cmd_obj = cmd_obj.read().unwrap();

View file

@ -41,7 +41,7 @@ pub fn init_ctx(ctx: &mut Context) {
if vertical_view { if vertical_view {
let editor = node.get_edit::<crate::editors::list::ListEditor>().unwrap(); let editor = node.get_edit::<crate::editors::list::ListEditor>().unwrap();
let mut e = editor.write().unwrap(); let mut e = editor.write().unwrap();
let mut seg_view = PTYListStyle::new( ("","~",""), node.depth.get() ).get_seg_seq_view( &mut e ); let seg_view = PTYListStyle::new( ("","~",""), node.depth.get() ).get_seg_seq_view( &mut e );
node = node.set_view( node = node.set_view(
seg_view.to_grid_vertical().flatten() seg_view.to_grid_vertical().flatten()

View file

@ -6,8 +6,8 @@ pub use ctx::init_ctx;
use { use {
r3vi::{ r3vi::{
buffer::{singleton::*, vec::*}, buffer::{singleton::*},
view::{singleton::*, sequence::*, OuterViewPort} view::{singleton::*, sequence::*}
}, },
crate::{ crate::{
type_system::{Context, TypeID, TypeTerm, ReprTree}, type_system::{Context, TypeID, TypeTerm, ReprTree},
@ -15,8 +15,7 @@ use {
tree::{NestedNode, TreeNav, TreeNavResult, TreeCursor}, tree::{NestedNode, TreeNav, TreeNavResult, TreeCursor},
commander::ObjCommander commander::ObjCommander
}, },
std::{sync::{Arc, RwLock, Mutex}, any::Any}, std::{sync::{Arc, RwLock}}
cgmath::{Vector2}
}; };
#[derive(PartialEq, Eq, Clone, Copy, Debug)] #[derive(PartialEq, Eq, Clone, Copy, Debug)]
@ -176,7 +175,7 @@ impl TypeTermEditor {
node.goto(TreeCursor::home()); node.goto(TreeCursor::home());
let editor = node.editor.get(); let _editor = node.editor.get();
self.close_char.set(node.close_char.get()); self.close_char.set(node.close_char.get());
self.cur_node.set(node); self.cur_node.set(node);
self.state = new_state; self.state = new_state;
@ -221,7 +220,7 @@ impl TypeTermEditor {
}) })
.to_grid() .to_grid()
.flatten(); .flatten();
let cc = editor.cur_node.get().close_char; let _cc = editor.cur_node.get().close_char;
let editor = Arc::new(RwLock::new(editor)); let editor = Arc::new(RwLock::new(editor));
let mut node = NestedNode::new(ctx, data, depth) let mut node = NestedNode::new(ctx, data, depth)
@ -292,8 +291,8 @@ impl TypeTermEditor {
pub fn normalize_empty(&mut self) { pub fn normalize_empty(&mut self) {
eprintln!("normalize singleton"); eprintln!("normalize singleton");
let mut subladder_list_node = self.cur_node.get().clone(); let subladder_list_node = self.cur_node.get().clone();
let mut subladder_list_edit = subladder_list_node.get_edit::<ListEditor>().unwrap(); let subladder_list_edit = subladder_list_node.get_edit::<ListEditor>().unwrap();
let subladder_list_edit = subladder_list_edit.read().unwrap(); let subladder_list_edit = subladder_list_edit.read().unwrap();
if subladder_list_edit.data.len() == 0 { if subladder_list_edit.data.len() == 0 {
@ -307,8 +306,8 @@ impl TypeTermEditor {
*/ */
pub fn normalize_singleton(&mut self) { pub fn normalize_singleton(&mut self) {
eprintln!("normalize singleton"); eprintln!("normalize singleton");
let mut subladder_list_node = self.cur_node.get().clone(); let subladder_list_node = self.cur_node.get().clone();
let mut subladder_list_edit = subladder_list_node.get_edit::<ListEditor>().unwrap(); let subladder_list_edit = subladder_list_node.get_edit::<ListEditor>().unwrap();
let subladder_list_edit = subladder_list_edit.read().unwrap(); let subladder_list_edit = subladder_list_edit.read().unwrap();
if subladder_list_edit.data.len() == 1 { if subladder_list_edit.data.len() == 1 {
@ -333,11 +332,11 @@ impl TypeTermEditor {
*/ */
pub fn normalize_nested_ladder(&mut self) { pub fn normalize_nested_ladder(&mut self) {
let mut subladder_list_node = self.cur_node.get().clone(); let mut subladder_list_node = self.cur_node.get().clone();
let mut subladder_list_edit = subladder_list_node.get_edit::<ListEditor>().unwrap(); let subladder_list_edit = subladder_list_node.get_edit::<ListEditor>().unwrap();
let item = subladder_list_edit.write().unwrap().get_item().clone(); let item = subladder_list_edit.write().unwrap().get_item().clone();
if let Some(mut it_node) = item { if let Some(it_node) = item {
if it_node.get_type() == (&self.ctx, "( Type )").into() { if it_node.get_type() == (&self.ctx, "( Type )").into() {
let other_tt = it_node.get_edit::<TypeTermEditor>().unwrap(); let other_tt = it_node.get_edit::<TypeTermEditor>().unwrap();
@ -441,8 +440,8 @@ impl TypeTermEditor {
/* create a new NestedNode with TerminaltypeEditor, /* create a new NestedNode with TerminaltypeEditor,
* that has same state & child-node as current node. * that has same state & child-node as current node.
*/ */
let mut old_edit_node = TypeTermEditor::new_node( self.ctx.clone(), self.depth ); let old_edit_node = TypeTermEditor::new_node( self.ctx.clone(), self.depth );
let mut old_edit_clone = old_edit_node.get_edit::<TypeTermEditor>().unwrap(); let old_edit_clone = old_edit_node.get_edit::<TypeTermEditor>().unwrap();
old_edit_clone.write().unwrap().set_state( self.state ); old_edit_clone.write().unwrap().set_state( self.state );
old_edit_clone.write().unwrap().close_char.set( old_node.close_char.get() ); old_edit_clone.write().unwrap().close_char.set( old_node.close_char.get() );
old_edit_clone.write().unwrap().cur_node.set( old_node ); old_edit_clone.write().unwrap().cur_node.set( old_node );

View file

@ -46,7 +46,7 @@ pub trait TreeNav {
TreeCursor::default() TreeCursor::default()
} }
fn get_height(&self, op: &TreeHeightOp) -> usize { fn get_height(&self, _op: &TreeHeightOp) -> usize {
0 0
} }

View file

@ -1,9 +1,9 @@
use { use {
std::{sync::{Arc, RwLock, Mutex}, any::Any}, std::{sync::{Arc, RwLock}, any::Any},
cgmath::{Vector2, Point2}, cgmath::{Vector2, Point2},
r3vi::{ r3vi::{
view::{ChannelReceiver, View, ViewPort, OuterViewPort, AnyOuterViewPort, singleton::*, sequence::*}, view::{View, ViewPort, OuterViewPort, AnyOuterViewPort, singleton::*, sequence::*},
buffer::{singleton::*, vec::*} buffer::{singleton::*}
}, },
crate::{ crate::{
type_system::{ReprTree, Context, TypeTerm}, type_system::{ReprTree, Context, TypeTerm},