Signed-off-by: discord9 <discord9@163.com>
This commit is contained in:
discord9
2026-02-03 20:10:35 +08:00
parent 96b690bfa2
commit 271fb1f73d
2 changed files with 7 additions and 6 deletions

View File

@@ -47,7 +47,7 @@ impl CompatCommand {
let from_version = match Version::parse(&self.from) {
Ok(v) => v,
Err(e) => {
eprintln!("Error parsing 'from' version: {}", e);
println!("Error parsing 'from' version: {}", e);
std::process::exit(1);
}
};
@@ -55,7 +55,7 @@ impl CompatCommand {
let to_version = match Version::parse(&self.to) {
Ok(v) => v,
Err(e) => {
eprintln!("Error parsing 'to' version: {}", e);
println!("Error parsing 'to' version: {}", e);
std::process::exit(1);
}
};
@@ -78,7 +78,7 @@ impl CompatCommand {
{
Ok(r) => r,
Err(e) => {
eprintln!("Failed to create compatibility runner: {}", e);
println!("Failed to create compatibility runner: {}", e);
std::process::exit(1);
}
};
@@ -88,7 +88,7 @@ impl CompatCommand {
println!("\x1b[32mCompatibility tests passed!\x1b[0m");
}
Err(e) => {
eprintln!("\x1b[31mCompatibility tests failed: {}\x1b[0m", e);
println!("\x1b[31mCompatibility tests failed: {}\x1b[0m", e);
std::process::exit(1);
}
}

View File

@@ -54,11 +54,12 @@ impl Version {
if lower == "current" {
Ok(Version::Current)
} else {
let inner = SemverVersion::parse(s).map_err(|e| VersionError::ParseError(e))?;
let inner = SemverVersion::parse(s).map_err(VersionError::ParseError)?;
Ok(Version::Semantic(inner))
}
}
#[allow(unused)]
pub fn is_current(&self) -> bool {
matches!(self, Version::Current)
}
@@ -131,7 +132,7 @@ impl Version {
impl PartialOrd for Version {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
Some(self.compare(other))
Some(Ord::cmp(self, other))
}
}