pub fn from_name(sign: &str) -> Result<CompOp, ()> {
        match sign.trim().to_lowercase().as_ref() {
            "eq" => Ok(CompOp::Eq),
            "ne" => Ok(CompOp::Ne),
            "lt" => Ok(CompOp::Lt),
            "le" => Ok(CompOp::Le),
            "ge" => Ok(CompOp::Ge),
            "gt" => Ok(CompOp::Gt),
            _ => Err(()),
        }
    }
/// Get a comparison operator by it's name.
/// Names are case-insensitive, and whitespaces are stripped from the string.
/// An error is returned if the name isn't recognized.
///
/// # Examples
///
/// ```
/// use version_compare::CompOp;
///
/// assert_eq!(CompOp::from_name("eq"), Ok(CompOp::Eq));
/// assert_eq!(CompOp::from_name("lt"), Ok(CompOp::Lt));
/// assert_eq!(CompOp::from_name("  Ge   "), Ok(CompOp::Ge));
/// assert!(CompOp::from_name("abc").is_err());
/// ```
Get a comparison operator by it's name.
Names are case-insensitive, and whitespaces are stripped from the string.
An error is returned if the name isn't recognized.
Get a comparison operator by it ' s name . Names are case - insensitive and whitespaces are stripped from the string . An error is returned if the name isn ' t recognized .
pub fn from_name(sign: &str) -> Result<CompOp, ()> {
        match sign.trim().to_lowercase().as_ref() {
            "eq" => Ok(CompOp::Eq),
            "ne" => Ok(CompOp::Ne),
            "lt" => Ok(CompOp::Lt),
            "le" => Ok(CompOp::Le),
            "ge" => Ok(CompOp::Ge),
            "gt" => Ok(CompOp::Gt),
            _ => Err(()),
        }
    }
pub fn from_name ( sign : & str ) -> Result < CompOp , ( ) > { match sign . trim ( ) . to_lowercase ( ) . as_ref ( ) { " " => Ok ( CompOp :: Eq ) , " " => Ok ( CompOp :: Ne ) , " " => Ok ( CompOp :: Lt ) , " " => Ok ( CompOp :: Le ) , " " => Ok ( CompOp :: Ge ) , " " => Ok ( CompOp :: Gt ) , _ => Err ( ( ) ) , } }
Get a comparison operator by it's name.
Get a comparison operator by it ' s name .
sign
&str
sign
&str
examples
```
use version_compare::CompOp.


` ` ` use version_compare :: CompOp .