fn from_str(ship: &str) -> Result<Self> {
        let (delimiter, kind) = if ship.contains('/') {
            ('/', ShipKind::Romantic)
        } else if ship.contains('&') {
            ('&', ShipKind::Platonic)
        } else {
            return Err(anyhow!("Unknown ship kind in: '{}'", ship));
        };

        // Split on separators to get characters
        let mut characters: Vec<String> = ship
            .split(delimiter)
            .map(|mut name| {
                if let Some(fandom_start) = name.find('(') {
                    name = &name[..fandom_start];
                }
                name.trim().to_owned()
            })
            .collect();
        characters.sort_unstable();

        Ok(Self { characters, kind })
    }
/// Given a ship tag, returns a pair of characters in the ship.
///
/// The pair of characters will be sorted, to make tag deduplication easier.
///
/// This function will return `None` if:
///
/// - the ship kind could not be determined
Given a ship tag, returns a pair of characters in the ship.
The pair of characters will be sorted, to make tag deduplication easier.

This function will return `None` if.

the ship kind could not be determined
Given a ship tag returns a pair of characters in the ship . The pair of characters will be sorted to make tag deduplication easier . This function will return ` None ` if . the ship kind could not be determined
fn from_str(ship: &str) -> Result<Self> {
        let (delimiter, kind) = if ship.contains('/') {
            ('/', ShipKind::Romantic)
        } else if ship.contains('&') {
            ('&', ShipKind::Platonic)
        } else {
            return Err(anyhow!("Unknown ship kind in: '{}'", ship));
        };
        // Split on separators to get characters
        let mut characters: Vec<String> = ship
            .split(delimiter)
            .map(|mut name| {
                if let Some(fandom_start) = name.find('(') {
                    name = &name[..fandom_start];
                }
                name.trim().to_owned()
            })
            .collect();
        characters.sort_unstable();
        Ok(Self { characters, kind })
    }
fn from_str ( ship : & str ) -> Result < Self > { let ( delimiter , kind ) = if ship . contains ( '/' ) { ( '/' , ShipKind :: Romantic ) } else if ship . contains ( '&' ) { ( '&' , ShipKind :: Platonic ) } else { return Err ( anyhow ! ( " " ship ) ) ; } ; // Split on separators to get characters let mut characters : Vec < String > = ship . split ( delimiter ) . map ( | mut name | { if let Some ( fandom_start ) = name . find ( '(' ) { name = & name [ .. fandom_start ] ; } name . trim ( ) . to_owned ( ) } ) . collect ( ) ; characters . sort_unstable ( ) ; Ok ( Self { characters , kind } ) }
Given a ship tag, returns a pair of characters in the ship.
Given a ship tag returns a pair of characters in the ship .
ship
&str
ship
&str