Skip to content

Commit 53b0c5e

Browse files
committed
More
1 parent 63894b7 commit 53b0c5e

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

crates/bevy_text/src/undo_2/lib.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#![doc = include_str!("./README.md")]
22
#![doc = document_features::document_features!()]
3+
use alloc::{slice, vec};
34
use core::borrow::Borrow;
45
use core::cmp::min;
6+
use core::fmt::Debug;
57
use core::iter::FusedIterator;
68
use core::ops::ControlFlow;
79
use core::ops::{Deref, Index};
810
use core::option;
9-
use core::fmt::Debug;
10-
use std::hash::{DefaultHasher, Hash, Hasher as _};
1111
use core::slice::SliceIndex;
12-
use alloc::{slice, vec};
12+
use std::hash::{DefaultHasher, Hash, Hasher as _};
1313

1414
#[cfg(feature = "serde")]
1515
use serde::{Deserialize, Serialize};
@@ -72,6 +72,7 @@ pub enum Action<T> {
7272
/// use std::mem::{discriminant, Discriminant};
7373
///
7474
/// use crate::undo_2::{Commands, IndepStateKey, SetOrTransition, SetTransAction};
75+
/// use crate::undo_2::SetTransAction::*;
7576
///
7677
/// #[derive(Copy, Clone, Debug)]
7778
/// struct State {
@@ -136,7 +137,7 @@ pub enum Action<T> {
136137
/// B,
137138
/// }
138139
///
139-
/// use SetOrTransition::*;
140+
/// use crate::undo_2::SetTransAction::*;
140141
/// let mut commands = Commands::new();
141142
/// let mut state = State::new();
142143
///
@@ -1480,9 +1481,10 @@ impl<T> Commands<T> {
14801481
let i0 = i;
14811482
for j in i0..end {
14821483
if let CommandItem::Undo(count) = self.commands[j]
1483-
&& j - count - 1 < i {
1484-
i = self.remove_i(j - count - 1, i);
1485-
}
1484+
&& j - count - 1 < i
1485+
{
1486+
i = self.remove_i(j - count - 1, i);
1487+
}
14861488
}
14871489
i
14881490
}

crates/bevy_text/src/undo_2/tests/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#[expect(clippy::allow_attributes_without_reason)]
2-
2+
#[expect(clippy::match_same_arms)]
33
mod iter_realized;
44
mod merge;
55
mod redo;

0 commit comments

Comments
 (0)