Fix message order and cursor movement
This commit is contained in:
parent
8cbdc89b7e
commit
b918f0f31f
3 changed files with 13 additions and 3 deletions
|
|
@ -1,13 +1,14 @@
|
|||
pub mod dummy;
|
||||
|
||||
use std::collections::HashMap;
|
||||
use std::fmt::Debug;
|
||||
use std::hash::Hash;
|
||||
|
||||
use async_trait::async_trait;
|
||||
use chrono::{DateTime, Utc};
|
||||
|
||||
pub trait Msg {
|
||||
type Id: Clone + Hash + Eq;
|
||||
type Id: Clone + Debug + Hash + Eq + Ord;
|
||||
fn id(&self) -> Self::Id;
|
||||
fn parent(&self) -> Option<Self::Id>;
|
||||
|
||||
|
|
@ -63,6 +64,10 @@ impl<M: Msg> Tree<M> {
|
|||
}
|
||||
}
|
||||
|
||||
for list in children.values_mut() {
|
||||
list.sort_unstable();
|
||||
}
|
||||
|
||||
Self {
|
||||
root,
|
||||
msgs,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue