Skip to content

Commit ab56486

Browse files
committed
More clippy
1 parent 53b0c5e commit ab56486

File tree

11 files changed

+40
-42
lines changed

11 files changed

+40
-42
lines changed

crates/bevy_text/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ pub use pipeline::*;
5656
pub use text::*;
5757
pub use text2d::*;
5858
pub use text_access::*;
59+
pub use undo_2::*;
5960

6061
/// The text prelude.
6162
///

crates/bevy_text/src/undo_2/lib.rs

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ pub enum Action<T> {
7171
/// ```
7272
/// use std::mem::{discriminant, Discriminant};
7373
///
74-
/// use crate::undo_2::{Commands, IndepStateKey, SetOrTransition, SetTransAction};
75-
/// use crate::undo_2::SetTransAction::*;
74+
/// use bevy_text::undo_2::{Commands, IndepStateKey, SetOrTransition, SetTransAction};
75+
/// use bevy_text::undo_2::SetTransAction::Transition;
7676
///
7777
/// #[derive(Copy, Clone, Debug)]
7878
/// struct State {
@@ -137,7 +137,7 @@ pub enum Action<T> {
137137
/// B,
138138
/// }
139139
///
140-
/// use crate::undo_2::SetTransAction::*;
140+
/// use bevy_text::undo_2::SetTransAction::*;
141141
/// let mut commands = Commands::new();
142142
/// let mut state = State::new();
143143
///
@@ -248,7 +248,7 @@ impl<T> Action<T> {
248248
/// # Example
249249
///
250250
/// ```
251-
/// use crate::undo_2::{Commands,CommandItem};
251+
/// use bevy_text::undo_2::{Commands,CommandItem};
252252
///
253253
/// let mut commands = Commands::new();
254254
///
@@ -288,7 +288,7 @@ pub enum CommandItem<T> {
288288
///
289289
/// # Example
290290
/// ```
291-
/// use crate::undo_2::{Action, Commands};
291+
/// use bevy_text::undo_2::{Action, Commands};
292292
///
293293
/// #[derive(Debug, Eq, PartialEq)]
294294
/// enum Command {
@@ -539,7 +539,7 @@ impl<T> Commands<T> {
539539
/// if it is not an Undo.
540540
/// # Example
541541
/// ```
542-
/// use crate::undo_2::{Commands, CommandItem};
542+
/// use bevy_text::undo_2::{Commands, CommandItem};
543543
///
544544
/// #[derive(Debug, Eq, PartialEq)]
545545
/// enum Command {
@@ -569,7 +569,7 @@ impl<T> Commands<T> {
569569
/// if it is not an Undo.
570570
/// # Example
571571
/// ```
572-
/// use crate::undo_2::{Commands, CommandItem};
572+
/// use bevy_text::undo_2::{Commands, CommandItem};
573573
///
574574
/// #[derive(Debug, Eq, PartialEq)]
575575
/// enum Command {
@@ -607,7 +607,7 @@ impl<T> Commands<T> {
607607
///
608608
/// # Example
609609
/// ```
610-
/// use crate::undo_2::{Commands, CommandItem};
610+
/// use bevy_text::undo_2::{Commands, CommandItem};
611611
///
612612
/// #[derive(Debug, Eq, PartialEq)]
613613
/// enum Command {
@@ -654,7 +654,7 @@ impl<T> Commands<T> {
654654
///
655655
/// # Example
656656
/// ```
657-
/// use crate::undo_2::{Commands, CommandItem};
657+
/// use bevy_text::undo_2::{Commands, CommandItem};
658658
///
659659
/// #[derive(Debug, Eq, PartialEq)]
660660
/// enum Command {
@@ -700,7 +700,7 @@ impl<T> Commands<T> {
700700
///
701701
/// # Example
702702
/// ```
703-
/// use crate::undo_2::Commands;
703+
/// use bevy_text::undo_2::Commands;
704704
///
705705
/// #[derive(Debug, Eq, PartialEq)]
706706
/// enum Command {
@@ -725,7 +725,7 @@ impl<T> Commands<T> {
725725
///
726726
/// # Example
727727
/// ```
728-
/// use crate::undo_2::{Action,Commands};
728+
/// use bevy_text::undo_2::{Action,Commands};
729729
///
730730
/// #[derive(Debug, Eq, PartialEq)]
731731
/// enum Command {
@@ -772,7 +772,7 @@ impl<T> Commands<T> {
772772
///
773773
/// # Example
774774
/// ```
775-
/// use crate::undo_2::{Action,Commands};
775+
/// use bevy_text::undo_2::{Action,Commands};
776776
///
777777
/// #[derive(Debug, Eq, PartialEq)]
778778
/// enum Command {
@@ -837,7 +837,7 @@ impl<T> Commands<T> {
837837
///
838838
/// # Example
839839
/// ```
840-
/// use crate::undo_2::{Commands,Action};
840+
/// use bevy_text::undo_2::{Commands,Action};
841841
///
842842
/// #[derive(Debug, Eq, PartialEq)]
843843
/// enum Command {
@@ -913,7 +913,7 @@ impl<T> Commands<T> {
913913
///
914914
/// # Example
915915
/// ```
916-
/// use crate::undo_2::{Action,Commands};
916+
/// use bevy_text::undo_2::{Action,Commands};
917917
///
918918
/// #[derive(Debug, Eq, PartialEq)]
919919
/// enum Command {
@@ -941,7 +941,7 @@ impl<T> Commands<T> {
941941
///
942942
/// # Example
943943
/// ```
944-
/// use crate::undo_2::{Action,Commands};
944+
/// use bevy_text::undo_2::{Action,Commands};
945945
///
946946
/// #[derive(Debug, Eq, PartialEq)]
947947
/// enum Command {
@@ -989,7 +989,7 @@ impl<T> Commands<T> {
989989
///
990990
/// # Example
991991
/// ```
992-
/// use crate::undo_2::{Action,Commands};
992+
/// use bevy_text::undo_2::{Action,Commands};
993993
///
994994
/// #[derive(Debug, Eq, PartialEq)]
995995
/// enum Command {
@@ -1022,7 +1022,7 @@ impl<T> Commands<T> {
10221022
///
10231023
/// # Example
10241024
/// ```
1025-
/// use crate::undo_2::{Action,Commands};
1025+
/// use bevy_text::undo_2::{Action,Commands};
10261026
///
10271027
/// #[derive(Debug, Eq, PartialEq)]
10281028
/// enum Command {
@@ -1059,7 +1059,7 @@ impl<T> Commands<T> {
10591059
///
10601060
/// # Example
10611061
/// ```
1062-
/// use crate::undo_2::Commands;
1062+
/// use bevy_text::undo_2::Commands;
10631063
///
10641064
/// #[derive(Debug, Eq, PartialEq)]
10651065
/// enum Command {
@@ -1095,7 +1095,7 @@ impl<T> Commands<T> {
10951095
///
10961096
/// # Example
10971097
/// ```
1098-
/// use crate::undo_2::Commands;
1098+
/// use bevy_text::undo_2::Commands;
10991099
///
11001100
/// #[derive(Debug, Eq, PartialEq)]
11011101
/// enum Command {
@@ -1124,7 +1124,7 @@ impl<T> Commands<T> {
11241124
///
11251125
/// # Example
11261126
/// ```
1127-
/// use crate::undo_2::Commands;
1127+
/// use bevy_text::undo_2::Commands;
11281128
///
11291129
/// #[derive(Debug, Eq, PartialEq)]
11301130
/// enum Command {
@@ -1150,7 +1150,7 @@ impl<T> Commands<T> {
11501150
///
11511151
/// # Example
11521152
/// ```
1153-
/// use crate::undo_2::*;
1153+
/// use bevy_text::undo_2::*;
11541154
/// #[derive(Debug, Eq, PartialEq)]
11551155
/// enum Command {
11561156
/// A,
@@ -1185,7 +1185,7 @@ impl<T> Commands<T> {
11851185
/// the [`CommandItem`] index passed `index`.
11861186
///
11871187
/// ```
1188-
/// use crate::undo_2::{Action,Commands, CommandItem};
1188+
/// use bevy_text::undo_2::{Action,Commands, CommandItem};
11891189
/// use std::time::{Instant, Duration};
11901190
///
11911191
/// #[derive(Debug, Eq, PartialEq)]
@@ -1249,7 +1249,7 @@ impl<T> Commands<T> {
12491249
/// # Example
12501250
///
12511251
/// ```
1252-
/// use crate::undo_2::Commands;
1252+
/// use bevy_text::undo_2::Commands;
12531253
///
12541254
/// #[derive(Debug, Eq, PartialEq)]
12551255
/// enum Command {
@@ -1280,7 +1280,7 @@ impl<T> Commands<T> {
12801280
/// Complexity: O(n)
12811281
///
12821282
/// ```
1283-
/// use crate::undo_2::Commands;
1283+
/// use bevy_text::undo_2::Commands;
12841284
/// use std::time::{Instant, Duration};
12851285
///
12861286
/// #[derive(Debug, Eq, PartialEq)]
@@ -1349,7 +1349,7 @@ impl<T> Commands<T> {
13491349
/// Complexity: O(n)
13501350
///
13511351
/// ```
1352-
/// use crate::undo_2::Commands;
1352+
/// use bevy_text::undo_2::Commands;
13531353
/// use std::time::{Instant, Duration};
13541354
///
13551355
/// #[derive(Debug, Eq, PartialEq)]
@@ -1415,7 +1415,7 @@ impl<T> Commands<T> {
14151415
/// Complexity: O(n)
14161416
///
14171417
/// ```
1418-
/// use crate::undo_2::Commands;
1418+
/// use bevy_text::undo_2::Commands;
14191419
/// use std::time::{Instant, Duration};
14201420
///
14211421
/// #[derive(Debug, Eq, PartialEq)]
@@ -1505,7 +1505,7 @@ impl<T> Commands<T> {
15051505
/// The iterator would iterator over the sequence [C, A].
15061506
///
15071507
/// ```
1508-
/// use crate::undo_2::Commands;
1508+
/// use bevy_text::undo_2::Commands;
15091509
///
15101510
/// #[derive(Debug, Eq, PartialEq)]
15111511
/// enum Command {
@@ -1556,7 +1556,7 @@ impl<T> Commands<T> {
15561556
/// # Example
15571557
///
15581558
/// ```
1559-
/// use crate::undo_2::{Commands, CommandItem, Merge, IterRealized};
1559+
/// use bevy_text::undo_2::{Commands, CommandItem, Merge, IterRealized};
15601560
/// use std::ops::ControlFlow;
15611561
///
15621562
/// #[derive(Eq, PartialEq, Debug)]
@@ -1624,7 +1624,7 @@ impl<T> Commands<T> {
16241624
/// # Example
16251625
///
16261626
/// ```
1627-
/// use crate::undo_2::{Commands, CommandItem, Splice, IterRealized};
1627+
/// use bevy_text::undo_2::{Commands, CommandItem, Splice, IterRealized};
16281628
/// use std::ops::ControlFlow;
16291629
///
16301630
/// // we suppose that A, B, C is equivalent to D,E
@@ -1716,7 +1716,7 @@ impl<T> Commands<T> {
17161716
///
17171717
/// # Example
17181718
/// ```
1719-
/// use crate::undo_2::{CommandItem, Commands};
1719+
/// use bevy_text::undo_2::{CommandItem, Commands};
17201720
///
17211721
/// #[derive(Debug, PartialEq)]
17221722
/// enum Command {
@@ -1744,7 +1744,7 @@ impl<T> Commands<T> {
17441744
///
17451745
/// # Example
17461746
/// ```
1747-
/// use crate::undo_2::{Commands,CommandItem};
1747+
/// use bevy_text::undo_2::{Commands,CommandItem};
17481748
///
17491749
/// #[derive(Debug, PartialEq)]
17501750
/// enum Command {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![allow(unused)]
1+
#![allow(unused, reason="tests")]
22

33
use crate::undo_2::*;
44

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#[expect(clippy::allow_attributes_without_reason)]
2-
#[expect(clippy::match_same_arms)]
31
mod iter_realized;
42
mod merge;
53
mod redo;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![allow(unused)]
1+
#![allow(unused, reason="tests")]
22
use crate::undo_2::{Action, Commands};
33

44
#[derive(Debug, Eq, PartialEq)]

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![allow(unused)]
1+
#![allow(unused, reason="tests")]
22
use crate::undo_2::*;
33

44
#[test]

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ impl State {
1919
}
2020
fn execute_action(&mut self, c: SetTransAction<SetCommands, TransitionCommand>) {
2121
match c {
22-
SetTransAction::Do(_) => {}
23-
SetTransAction::Undo(_) => {}
22+
SetTransAction::Do(_) | SetTransAction::Undo(_) => {}
2423
SetTransAction::Set(c) => self.apply_set(c),
2524
SetTransAction::SetToInitial(d) => self.apply_set(SetCommands::new_initial(d)),
2625
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![allow(unused)]
1+
#![allow(unused, reason="tests")]
22

33
use crate::undo_2::*;
44
use core::ops::ControlFlow;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![allow(unused)]
1+
#![allow(unused, reason="tests")]
22
use crate::undo_2::{Action, Commands};
33

44
#[derive(Debug, Eq, PartialEq)]

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![allow(unused)]
1+
#![allow(unused, reason="tests")]
22
use crate::undo_2::{Action, Commands};
33

44
#[derive(Debug, Eq, PartialEq)]

0 commit comments

Comments
 (0)