summaryrefslogtreecommitdiffstats
path: root/vendor/prodash/src/progress
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/prodash/src/progress')
-rw-r--r--vendor/prodash/src/progress/key.rs9
-rw-r--r--vendor/prodash/src/progress/log.rs2
-rw-r--r--vendor/prodash/src/progress/mod.rs9
-rw-r--r--vendor/prodash/src/progress/utils.rs8
4 files changed, 9 insertions, 19 deletions
diff --git a/vendor/prodash/src/progress/key.rs b/vendor/prodash/src/progress/key.rs
index dae714d68..bfdf13b2d 100644
--- a/vendor/prodash/src/progress/key.rs
+++ b/vendor/prodash/src/progress/key.rs
@@ -15,12 +15,13 @@ pub(crate) type Id = u16;
pub struct Key(Option<Id>, Option<Id>, Option<Id>, Option<Id>, Option<Id>, Option<Id>);
/// Determines if a sibling is above or below in the given level of hierarchy
-#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug)]
+#[derive(Default, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug)]
#[allow(missing_docs)]
pub enum SiblingLocation {
Above,
Below,
AboveAndBelow,
+ #[default]
NotFound,
}
@@ -40,12 +41,6 @@ impl SiblingLocation {
}
}
-impl Default for SiblingLocation {
- fn default() -> Self {
- SiblingLocation::NotFound
- }
-}
-
/// A type providing information about what's above and below `Tree` items.
#[derive(Copy, Clone, Default, Eq, PartialEq, Ord, PartialOrd, Debug)]
pub struct Adjacency(
diff --git a/vendor/prodash/src/progress/log.rs b/vendor/prodash/src/progress/log.rs
index 3410a5dc2..6fb16f109 100644
--- a/vendor/prodash/src/progress/log.rs
+++ b/vendor/prodash/src/progress/log.rs
@@ -136,7 +136,7 @@ impl Progress for Log {
self.id
}
- fn message(&mut self, level: MessageLevel, message: impl Into<String>) {
+ fn message(&self, level: MessageLevel, message: impl Into<String>) {
let message: String = message.into();
match level {
MessageLevel::Info => log::info!("ℹ{} → {}", self.name, message),
diff --git a/vendor/prodash/src/progress/mod.rs b/vendor/prodash/src/progress/mod.rs
index 0d9c694cf..842bbb6e1 100644
--- a/vendor/prodash/src/progress/mod.rs
+++ b/vendor/prodash/src/progress/mod.rs
@@ -41,7 +41,7 @@ pub type Step = usize;
pub type StepShared = Arc<AtomicUsize>;
/// Indicate whether a progress can or cannot be made.
-#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
+#[derive(Default, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug, Hash)]
pub enum State {
/// Indicates a task is blocked and cannot indicate progress, optionally until the
/// given time. The task cannot easily be interrupted.
@@ -50,15 +50,10 @@ pub enum State {
/// given time. The task can be interrupted.
Halted(&'static str, Option<SystemTime>),
/// The task is running
+ #[default]
Running,
}
-impl Default for State {
- fn default() -> Self {
- State::Running
- }
-}
-
/// Progress associated with some item in the progress tree.
#[derive(Clone, Default, Debug)]
pub struct Value {
diff --git a/vendor/prodash/src/progress/utils.rs b/vendor/prodash/src/progress/utils.rs
index 549a0b6e5..3fd6c64bf 100644
--- a/vendor/prodash/src/progress/utils.rs
+++ b/vendor/prodash/src/progress/utils.rs
@@ -38,7 +38,7 @@ impl Progress for Discard {
crate::progress::UNKNOWN
}
- fn message(&mut self, _level: MessageLevel, _message: impl Into<String>) {}
+ fn message(&self, _level: MessageLevel, _message: impl Into<String>) {}
fn counter(&self) -> Option<StepShared> {
None
@@ -144,7 +144,7 @@ where
todo!()
}
- fn message(&mut self, level: MessageLevel, message: impl Into<String>) {
+ fn message(&self, level: MessageLevel, message: impl Into<String>) {
match self {
Either::Left(l) => l.message(level, message),
Either::Right(r) => r.message(level, message),
@@ -247,7 +247,7 @@ where
self.0.id()
}
- fn message(&mut self, level: MessageLevel, message: impl Into<String>) {
+ fn message(&self, level: MessageLevel, message: impl Into<String>) {
self.0.message(level, message)
}
@@ -321,7 +321,7 @@ impl<T: Progress> Progress for ThroughputOnDrop<T> {
self.0.id()
}
- fn message(&mut self, level: MessageLevel, message: impl Into<String>) {
+ fn message(&self, level: MessageLevel, message: impl Into<String>) {
self.0.message(level, message)
}