fixes for 'nom' out of date

This commit is contained in:
Christien Rioux 2024-03-03 00:42:22 -05:00
parent e98877fc71
commit bf6be2beed
5 changed files with 560 additions and 458 deletions

989
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -12,7 +12,6 @@ resolver = "2"
[patch.crates-io] [patch.crates-io]
cursive = { git = "https://gitlab.com/veilid/cursive.git" } cursive = { git = "https://gitlab.com/veilid/cursive.git" }
cursive_core = { git = "https://gitlab.com/veilid/cursive.git" } cursive_core = { git = "https://gitlab.com/veilid/cursive.git" }
nom = { git = "https://gitlab.com/emixa-d/ansi-parser.git" }
# For local development # For local development
# keyvaluedb = { path = "../keyvaluedb/keyvaluedb" } # keyvaluedb = { path = "../keyvaluedb/keyvaluedb" }

View File

@ -38,7 +38,7 @@ cursive = { git = "https://gitlab.com/veilid/cursive.git", default-features = fa
cursive_buffered_backend = { git = "https://gitlab.com/veilid/cursive-buffered-backend.git" } cursive_buffered_backend = { git = "https://gitlab.com/veilid/cursive-buffered-backend.git" }
# cursive-multiplex = "0.6.0" # cursive-multiplex = "0.6.0"
# cursive_tree_view = "0.6.0" # cursive_tree_view = "0.6.0"
cursive_table_view = "0.14.0" cursive_table_view = { path = "../../cursive_table_view" }
arboard = "3.3.0" arboard = "3.3.0"
# cursive-tabs = "0.5.0" # cursive-tabs = "0.5.0"
clap = { version = "4", features = ["derive"] } clap = { version = "4", features = ["derive"] }

View File

@ -63,7 +63,7 @@ pub type NodeEventsPanel = Panel<NamedView<ScrollView<NamedView<CachedTextView>>
static START_TIME: AtomicU64 = AtomicU64::new(0); static START_TIME: AtomicU64 = AtomicU64::new(0);
pub type CursiveUICallback = Box<dyn Fn(&mut Cursive) + Send>; pub type CursiveUICallback = Box<dyn Fn(&mut Cursive) + Send + Sync>;
struct UIState { struct UIState {
attachment_state: Dirty<String>, attachment_state: Dirty<String>,
@ -388,7 +388,7 @@ impl CursiveUI {
close_cb: Option<CursiveUICallback>, close_cb: Option<CursiveUICallback>,
) { ) {
// Creates a dialog around some text with a single button // Creates a dialog around some text with a single button
let close_cb = Rc::new(close_cb); let close_cb = Arc::new(close_cb);
let close_cb2 = close_cb.clone(); let close_cb2 = close_cb.clone();
s.add_layer( s.add_layer(
Dialog::around(TextView::new(contents).scrollable()) Dialog::around(TextView::new(contents).scrollable())
@ -631,7 +631,8 @@ impl CursiveUI {
} }
} }
fn on_submit_peers_table_view(s: &mut Cursive, _row: usize, index: usize) { fn on_submit_peers_table_view(s: &mut Cursive, _row: Option<usize>, index: Option<usize>) {
if let Some(index) = index {
let peers_table_view = CursiveUI::peers(s); let peers_table_view = CursiveUI::peers(s);
let node_id = peers_table_view let node_id = peers_table_view
.borrow_item(index) .borrow_item(index)
@ -640,6 +641,7 @@ impl CursiveUI {
Self::copy_to_clipboard(s, node_id); Self::copy_to_clipboard(s, node_id);
} }
} }
}
fn on_focus_peers_table_view<T>(ptv: &mut ResizedView<T>) -> EventResult { fn on_focus_peers_table_view<T>(ptv: &mut ResizedView<T>) -> EventResult {
ptv.set_height(SizeConstraint::Full); ptv.set_height(SizeConstraint::Full);

View File

@ -81,11 +81,7 @@ fn append_hash<P: AsRef<Path>, Q: AsRef<Path>>(input_path: P, output_path: Q) {
let output_path = output_path.as_ref(); let output_path = output_path.as_ref();
let lines = std::io::BufReader::new(std::fs::File::open(input_path).unwrap()).lines(); let lines = std::io::BufReader::new(std::fs::File::open(input_path).unwrap()).lines();
let h = calculate_hash(lines); let h = calculate_hash(lines);
let mut out_file = OpenOptions::new() let mut out_file = OpenOptions::new().append(true).open(output_path).unwrap();
.write(true)
.append(true)
.open(output_path)
.unwrap();
writeln!(out_file, "\n//BUILDHASH:{}", hex::encode(h)).unwrap(); writeln!(out_file, "\n//BUILDHASH:{}", hex::encode(h)).unwrap();
} }