mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-01 10:15:31 +00:00
http_protocol: add AnnounceEvent::as_str, run cargo fmt
This commit is contained in:
parent
b9c029b5ed
commit
87223f7952
2 changed files with 18 additions and 3 deletions
|
|
@ -52,6 +52,17 @@ impl FromStr for AnnounceEvent {
|
|||
}
|
||||
}
|
||||
|
||||
impl AnnounceEvent {
|
||||
pub fn as_str(&self) -> Option<&str> {
|
||||
match self {
|
||||
Self::Started => Some("started"),
|
||||
Self::Stopped => Some("stopped"),
|
||||
Self::Completed => Some("completed"),
|
||||
Self::Empty => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
impl quickcheck::Arbitrary for InfoHash {
|
||||
fn arbitrary(g: &mut quickcheck::Gen) -> Self {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue