Skip to content

Commit

Permalink
Added comment about fromStr
Browse files Browse the repository at this point in the history
  • Loading branch information
folkengine committed Jan 4, 2025
1 parent 1e06105 commit 76b7350
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/cards/card.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ impl Card {
}

/// Instantiates a new Card with the default weight as defined in the fluent templates.
///
/// Me not knowing about the FromStr trait at the time. See also
/// [Creating a Rust function that accepts String or &str](https://hermanradtke.com/2015/05/06/creating-a-rust-function-that-accepts-string-or-str.html/)
#[must_use]
pub fn from_index_strings(rank: &'static str, suit: &'static str) -> Self {
Self::new(Rank::new(rank), Suit::new(suit))
Expand Down

0 comments on commit 76b7350

Please sign in to comment.