Skip to content

Commit 3a82cf5

Browse files
committed
Impl Display for DistributionType
1 parent 07a14ed commit 3a82cf5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/distribution.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use std::fmt;
12
use std::io::{BufReader, Read};
23
use std::path::Path;
34
use std::str::FromStr;
@@ -34,6 +35,16 @@ pub struct Distribution {
3435
python_version: String,
3536
}
3637

38+
impl fmt::Display for DistributionType {
39+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
40+
match self {
41+
DistributionType::SDist => write!(f, "sdist"),
42+
DistributionType::Egg => write!(f, "bdist_egg"),
43+
DistributionType::Wheel => write!(f, "bdist_wheel"),
44+
}
45+
}
46+
}
47+
3748
impl FromStr for SDistType {
3849
type Err = Error;
3950

0 commit comments

Comments
 (0)