-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: merge pull request #11 from websublime/feature/repo-url
feat: method to format repo url
- Loading branch information
Showing
9 changed files
with
248 additions
and
26 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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::fmt::{Display, Error, Formatter}; | ||
|
||
#[derive(Debug)] | ||
pub enum PackageJsonErrorEnum { | ||
InvalidName(String), | ||
InvalidDescription(String), | ||
InvalidVersion(String), | ||
InvalidRepository(String), | ||
InvalidFiles(String), | ||
InvalidLicense(String), | ||
UnknownErr, | ||
} | ||
|
||
impl std::error::Error for PackageJsonErrorEnum {} | ||
|
||
impl Display for PackageJsonErrorEnum { | ||
fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error> { | ||
match self { | ||
PackageJsonErrorEnum::InvalidName(message) => { | ||
write!(f, "{}", message) | ||
} | ||
PackageJsonErrorEnum::InvalidDescription(message) => { | ||
write!(f, "{}", message) | ||
} | ||
PackageJsonErrorEnum::InvalidVersion(message) => { | ||
write!(f, "{}", message) | ||
} | ||
PackageJsonErrorEnum::InvalidRepository(message) => { | ||
write!(f, "{}", message) | ||
} | ||
PackageJsonErrorEnum::InvalidFiles(message) => { | ||
write!(f, "{}", message) | ||
} | ||
PackageJsonErrorEnum::InvalidLicense(message) => { | ||
write!(f, "{}", message) | ||
} | ||
_ => todo!(), | ||
} | ||
} | ||
} | ||
|
||
// Err(PackageJsonErrorEnum::InvalidName("No valid name")) |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
pub mod errors; | ||
pub mod packages; | ||
pub mod utils; |
Oops, something went wrong.