Skip to content

Commit

Permalink
⚰️ Remove: StreamType enum and StreamContext enum [#64]
Browse files Browse the repository at this point in the history
Because the `Client::get_stream` method is removed.
  • Loading branch information
Rinrin0413 committed Nov 10, 2024
1 parent a299752 commit d6c9e74
Showing 1 changed file with 0 additions and 67 deletions.
67 changes: 0 additions & 67 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1144,73 +1144,6 @@ where
pub mod stream {
//! Features for streams.

/// Enum for the stream type.
pub enum StreamType {
/// 40 LINES
FortyLines,
/// BLITZ
Blitz,
/// Any
Any,
/// TETRA LEAGUE
League,
}

impl StreamType {
/// Converts to a `&str`.
///
/// # Examples
///
/// ```ignore
/// # use tetr_ch::client::stream::StreamType;
/// let forty_lines = StreamType::FortyLines;
/// let blitz = StreamType::Blitz;
/// let any = StreamType::Any;
/// let league = StreamType::League;
/// assert_eq!(forty_lines.as_str(), "40l");
/// assert_eq!(blitz.as_str(), "blitz");
/// assert_eq!(any.as_str(), "any");
/// assert_eq!(league.as_str(), "league");
/// ```
pub(crate) fn as_str(&self) -> &str {
match self {
StreamType::FortyLines => "40l",
StreamType::Blitz => "blitz",
StreamType::Any => "any",
StreamType::League => "league",
}
}
}

/// Enum for the stream context.
pub enum StreamContext {
Global,
UserBest,
UserRecent,
}

impl StreamContext {
/// Converts to a `&str`.
///
/// # Examples
///
/// ```ignore
/// # use tetr_ch::client::stream::StreamContext;
/// let global = StreamContext::Global;
/// let user_best = StreamContext::UserBest;
/// let user_recent = StreamContext::UserRecent;
/// assert_eq!(global.as_str(), "global");
/// assert_eq!(user_best.as_str(), "user_best");
/// assert_eq!(user_recent.as_str(), "user_recent");
pub(crate) fn as_str(&self) -> &str {
match self {
StreamContext::Global => "global",
StreamContext::UserBest => "userbest",
StreamContext::UserRecent => "userrecent",
}
}
}

/// The news subject.
pub enum NewsStream {
/// Global news.
Expand Down

0 comments on commit d6c9e74

Please sign in to comment.