Skip to content

Commit

Permalink
chore: add Copy to enums and structs
Browse files Browse the repository at this point in the history
  • Loading branch information
fekie committed Apr 6, 2023
1 parent 8b05dda commit d1ce996
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
10 changes: 7 additions & 3 deletions src/deals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use serde::{Deserialize, Serialize};
const DEALS_ACTIVITY_API: &str = "https://www.rolimons.com/api/activity2";

/// The objects returned from parsing the json from the endpoint <https://www.rolimons.com/api/activity2>.
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)]
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize, Copy)]
pub enum Activity {
/// A variant for a price update activity.
PriceUpdate(PriceUpdate),
Expand All @@ -17,7 +17,9 @@ pub enum Activity {
///
/// The meaning of the second and fourth values in the item part of the
/// json are currently unknown. Please submit an issue or pull request if you know what these are.
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Default, Serialize, Deserialize)]
#[derive(
Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Default, Serialize, Deserialize, Copy,
)]
pub struct PriceUpdate {
/// The timestamp of the activity in unix time.
pub timestamp: u64,
Expand All @@ -31,7 +33,9 @@ pub struct PriceUpdate {
///
/// These are usually only used for validating that deals are within deal % on the client side
/// of the deals page.
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Default, Serialize, Deserialize)]
#[derive(
Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Default, Serialize, Deserialize, Copy,
)]
pub struct RapUpdate {
/// The timestamp of the activity in unix time.
pub timestamp: u64,
Expand Down
8 changes: 6 additions & 2 deletions src/items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ use std::collections::HashMap;
const ITEM_DETAILS_API: &str = "https://www.rolimons.com/itemapi/itemdetails";

/// Represents the demand of an item.
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Default, Serialize, Deserialize)]
#[derive(
Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Default, Serialize, Deserialize, Copy,
)]
pub enum Demand {
/// The demand of the item is unassigned.
#[default]
Expand All @@ -24,7 +26,9 @@ pub enum Demand {
}

/// Represents the trend of an item.
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Default, Serialize, Deserialize)]
#[derive(
Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Default, Serialize, Deserialize, Copy,
)]
pub enum Trend {
#[default]
/// The trend of the item is unassigned.
Expand Down
2 changes: 1 addition & 1 deletion src/players.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ pub struct Badge {
}

/// The type of presence the player has on Roblox (e.g. InGame, Website).
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)]
#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize, Copy)]
pub enum PresenceType {
/// Rolimons is unable to find the player's presence type.
Unavailable,
Expand Down

0 comments on commit d1ce996

Please sign in to comment.