Skip to content

Commit

Permalink
Pass Copy argument by value
Browse files Browse the repository at this point in the history
  • Loading branch information
imp committed Sep 15, 2020
1 parent 0591a11 commit ae58b23
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/humantime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ pub enum Accuracy {

impl Accuracy {
/// Returns whether this accuracy is precise
pub fn is_precise(&self) -> bool {
*self == Accuracy::Precise
#[must_use]
pub fn is_precise(self) -> bool {
self == Self::Precise
}

/// Returns whether this accuracy is rough
pub fn is_rough(&self) -> bool {
*self == Accuracy::Rough
#[must_use]
pub fn is_rough(self) -> bool {
self == Self::Rough
}
}

Expand Down Expand Up @@ -121,6 +123,7 @@ impl TimePeriod {
pub struct HumanTime(Duration);

impl HumanTime {
#[must_use]
pub fn to_text_en(&self, accuracy: Accuracy, tense: Tense) -> String {
let mut periods = match accuracy {
Accuracy::Rough => self.rough_period(),
Expand Down

0 comments on commit ae58b23

Please sign in to comment.