mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-20 11:36:25 +08:00
chore: bump toolchain & fix lint
This commit is contained in:
@@ -255,9 +255,7 @@ export class LiveData<T = unknown>
|
||||
|
||||
constructor(
|
||||
initialValue: T,
|
||||
upstream:
|
||||
| ((upstream: Observable<LiveDataOperation>) => Observable<T>)
|
||||
| undefined = undefined
|
||||
upstream?: (upstream: Observable<LiveDataOperation>) => Observable<T>
|
||||
) {
|
||||
super();
|
||||
this.raw$ = new BehaviorSubject(initialValue);
|
||||
|
||||
@@ -37,6 +37,8 @@ impl PartialEq for Item {
|
||||
}
|
||||
}
|
||||
|
||||
impl Eq for Item {}
|
||||
|
||||
impl std::fmt::Debug for Item {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
let mut dbg = f.debug_struct("Item");
|
||||
|
||||
@@ -44,9 +44,7 @@ impl PartialEq for Node {
|
||||
}
|
||||
}
|
||||
|
||||
impl Eq for Node {
|
||||
fn assert_receiver_is_total_eq(&self) {}
|
||||
}
|
||||
impl Eq for Node {}
|
||||
|
||||
impl From<Item> for Node {
|
||||
fn from(value: Item) -> Self {
|
||||
|
||||
@@ -299,9 +299,7 @@ impl<T: PartialEq> PartialEq for SomrInner<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: PartialEq> Eq for Somr<T> {
|
||||
fn assert_receiver_is_total_eq(&self) {}
|
||||
}
|
||||
impl<T: Eq> Eq for Somr<T> {}
|
||||
|
||||
impl<T: PartialOrd> PartialOrd for Somr<T> {
|
||||
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
|
||||
|
||||
@@ -64,7 +64,7 @@ impl StoreHistory {
|
||||
|
||||
// make items as reference
|
||||
let mut store_items = store_items.iter().collect::<Vec<_>>();
|
||||
store_items.sort_by(|a, b| a.id.clock.cmp(&b.id.clock));
|
||||
store_items.sort_by_key(|item| item.id.clock);
|
||||
|
||||
self.parse_items(store_items)
|
||||
}
|
||||
@@ -126,7 +126,7 @@ impl StoreHistory {
|
||||
|
||||
// make items as reference
|
||||
let mut store_items = store_items.iter().collect::<Vec<_>>();
|
||||
store_items.sort_by(|a, b| a.id.clock.cmp(&b.id.clock));
|
||||
store_items.sort_by_key(|item| item.id.clock);
|
||||
|
||||
self.parse_items(store_items)
|
||||
}
|
||||
|
||||
@@ -266,11 +266,7 @@ fn advance_text_position(store: &mut DocStore, pos: &mut TextPosition, mut remai
|
||||
}
|
||||
|
||||
fn minimize_attribute_changes(pos: &mut TextPosition, attrs: &TextAttributes) {
|
||||
loop {
|
||||
let Some(item) = pos.right.get() else {
|
||||
break;
|
||||
};
|
||||
|
||||
while let Some(item) = pos.right.get() {
|
||||
if item.deleted() {
|
||||
pos.forward();
|
||||
continue;
|
||||
@@ -345,11 +341,7 @@ fn insert_negated_attributes(
|
||||
pos: &mut TextPosition,
|
||||
mut negated: TextAttributes,
|
||||
) -> JwstCodecResult {
|
||||
loop {
|
||||
let Some(item) = pos.right.get() else {
|
||||
break;
|
||||
};
|
||||
|
||||
while let Some(item) = pos.right.get() {
|
||||
if item.deleted() {
|
||||
pos.forward();
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user