fn version_string(&self, revision: Option<String>) -> String {
        let debianized_version;
        let mut version = &self.package.version;

        // Make debian's version ordering (newer versions) more compatible with semver's.
        // Keep "semver-1" and "semver-xxx" as-is (assuming these are irrelevant, or debian revision already),
        // but change "semver-beta.1" to "semver~beta.1"
        let mut parts = version.splitn(2, '-');
        let semver_main = parts.next().unwrap();
        if let Some(semver_pre) = parts.next() {
            let pre_ascii = semver_pre.as_bytes();
            if pre_ascii.iter().any(|c| !c.is_ascii_digit()) && pre_ascii.iter().any(|c| c.is_ascii_digit()) {
                debianized_version = format!("{}~{}", semver_main, semver_pre);
                version = &debianized_version;
            }
        }

        if let Some(revision) = revision {
            format!("{}-{}", version, revision)
        } else {
            version.to_owned()
        }
    }
/// Debian-compatible version of the semver version
Debian-compatible version of the semver version
Debian - compatible version of the semver version
fn version_string(&self, revision: Option<String>) -> String {
        let debianized_version;
        let mut version = &self.package.version;
        // Make debian's version ordering (newer versions) more compatible with semver's.
        // Keep "semver-1" and "semver-xxx" as-is (assuming these are irrelevant, or debian revision already),
        // but change "semver-beta.1" to "semver~beta.1"
        let mut parts = version.splitn(2, '-');
        let semver_main = parts.next().unwrap();
        if let Some(semver_pre) = parts.next() {
            let pre_ascii = semver_pre.as_bytes();
            if pre_ascii.iter().any(|c| !c.is_ascii_digit()) && pre_ascii.iter().any(|c| c.is_ascii_digit()) {
                debianized_version = format!("{}~{}", semver_main, semver_pre);
                version = &debianized_version;
            }
        }
        if let Some(revision) = revision {
            format!("{}-{}", version, revision)
        } else {
            version.to_owned()
        }
    }
fn version_string ( & self , revision : Option < String > ) -> String { let debianized_version ; let mut version = & self . package . version ; // Make debian's version ordering (newer versions) more compatible with semver's. // Keep "semver-1" and "semver-xxx" as-is (assuming these are irrelevant, or debian revision already), // but change "semver-beta.1" to "semver~beta.1" let mut parts = version . splitn ( 2 , '-' ) ; let semver_main = parts . next ( ) . unwrap ( ) ; if let Some ( semver_pre ) = parts . next ( ) { let pre_ascii = semver_pre . as_bytes ( ) ; if pre_ascii . iter ( ) . any ( | c | ! c . is_ascii_digit ( ) ) && pre_ascii . iter ( ) . any ( | c | c . is_ascii_digit ( ) ) { debianized_version = format ! ( " " semver_main semver_pre ) ; version = & debianized_version ; } } if let Some ( revision ) = revision { format ! ( " " version revision ) } else { version . to_owned ( ) } }
Debian-compatible version of the semver version
Debian - compatible version of the semver version
&self
revision
Option<String>
&self
revision
Option<String>