pub fn can_be_merged(&self, other: &Self) -> bool {
        let (lo, up) = match self.bounds(){
            None => return true,
            Some(a) => a
        };

        let (olo, oup) = match other.bounds() {
            None => return true,
            Some(a) => a
        };
        !(up.is_separated_from(&olo) || oup.is_separated_from(&lo))
    }
/**
    Checks if two intervals can be merged into one.

    # Example

    ```
    use advanced_collections::interval::Interval;
    fn main() {
       let a = Interval::closed(2,4);
       let b = Interval::closed(4,6);
       assert!(a.can_be_merged(&b));
    }
    ```
    */
Checks if two intervals can be merged into one.
Checks if two intervals can be merged into one .
pub fn can_be_merged(&self, other: &Self) -> bool {
        let (lo, up) = match self.bounds(){
            None => return true,
            Some(a) => a
        };
        let (olo, oup) = match other.bounds() {
            None => return true,
            Some(a) => a
        };
        !(up.is_separated_from(&olo) || oup.is_separated_from(&lo))
    }
pub fn can_be_merged ( & self , other : & Self ) -> bool { let ( lo , up ) = match self . bounds ( ) { None => return true , Some ( a ) => a } ; let ( olo , oup ) = match other . bounds ( ) { None => return true , Some ( a ) => a } ; ! ( up . is_separated_from ( & olo ) || oup . is_separated_from ( & lo ) ) }
Checks if two intervals can be merged into one.
Checks if two intervals can be merged into one .
&self
other
&Self
&self
other
&Self
example
```
use advanced_collections::interval::Interval;
fn main() {
let a = Interval::closed(2,4);
let b = Interval::closed(4,6);
assert!(a.can_be_merged(&b));
}
```
` ` ` use advanced_collections :: interval :: Interval ; fn main () { let a = Interval :: closed ( 2 4 ) ; let b = Interval :: closed ( 4 6 ) ; assert! ( a . can_be_merged ( &b )) ; } ` ` `