-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
65 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
use std::cmp::Ordering; | ||
|
||
use wasm_pkg_common::{digest::ContentDigest, package::Version}; | ||
|
||
/// Package release details. | ||
/// | ||
/// Returned by [`Client::get_release`] and passed to [`Client::stream_content`]. | ||
#[derive(Clone, Debug)] | ||
pub struct Release { | ||
pub version: Version, | ||
pub content_digest: ContentDigest, | ||
} | ||
|
||
#[derive(Clone, Debug, Eq)] | ||
pub struct VersionInfo { | ||
pub version: Version, | ||
pub yanked: bool, | ||
} | ||
|
||
impl Ord for VersionInfo { | ||
fn cmp(&self, other: &Self) -> Ordering { | ||
self.version.cmp(&other.version) | ||
} | ||
} | ||
|
||
impl PartialOrd for VersionInfo { | ||
fn partial_cmp(&self, other: &Self) -> Option<Ordering> { | ||
Some(self.version.cmp(&other.version)) | ||
} | ||
} | ||
|
||
impl PartialEq for VersionInfo { | ||
fn eq(&self, other: &Self) -> bool { | ||
self.version == other.version | ||
} | ||
} | ||
|
||
impl std::fmt::Display for VersionInfo { | ||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||
write!(f, "{version}", version = self.version) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters