This is my code:

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Chain {
    pub score: i64,
    pub refs: ChainHead,
    pub query: ChainHead,
    pub alignment: Vec<AlignmentRecord>,
    pub id: u32,
}

impl Chain {
    /// Create a new chain object from a chain block (header, alignment).
    ///
    /// # Arguments
    /// * `head` - A byte array containing the header of the chain block
    /// * `block` - A byte array containing the alignment of the chain block
    ///
    /// # Returns
    /// * Option<(u32, Self)>
    /// * None if the block is empty
    ///
    /// # Example
    ///
    /// ```
    /// use chainder as chain;
    ///
    /// let head = b"chain 4900 chrY 58368225 + 25985403 25985638 chr5 151006098 - 43257292 43257528 1\n";
    /// let block = b"9\t1\t0\n";
    /// let data = chain::Chain::from(head, block);
    /// println!("{:?}", data);
    ///
    /// > Some((1, Chain { score: 4900, refs: ChainHead { chr: "chrY", size: 58368225, strand: '+', start: 25985403, end: 25985638 },
    /// query: ChainHead { chr: "chr5", size: 151006098, strand: '-', start: 43257292, end: 43257528 },
    /// alignment: [AlignmentRecord { size: 9, dt: 1, dq: 0 }], id: 1 }));
    /// ```
    pub fn from(head: &[u8], block: &[u8]) -> Option<(u32, Self)> {
        let (score, refs, query, id) = Self::head(head);
        let alignment = AlignmentRecord::parse(block);

        Some((
            id,
            Self {
                score,
                refs,
                query,
                alignment,
                id,
            },
        ))
    }

    /// Get the chain object as a string.
    ///
    /// # Arguments
    /// * `self` - A chain object
    ///
    /// # Returns
    /// * String
    ///
    /// # Example
    ///
    /// ```
    /// use chainder as chain;
    ///
    /// let data = chain::Reader::from_file("/path/to/chainfile")?;
    /// let line = data.get(&12).unwrap().to_string();
    /// println!("{:?}", line);
    ///
    /// > "chain 4900 chrY 58368225 + 25985403 25985638 chr5 151006098 - 43257292 43257528 12\n9\t1\t0\n\n";
    /// ```
    pub fn to_string(&self) -> String {
        let mut acc = String::new();
        acc.push_str(&format!(
            "chain {} {} {} {}\n\n{}",
            self.score,
            self.refs.to_string(),
            self.query.to_string(),
            self.id,
            self.alignment
                .iter()
                .map(|a| a.to_string())
                .collect::<Vec<String>>()
                .join("\n")
        ));
        acc
    }

    /// Get the header of a chain object as a string.
    ///
    /// # Arguments
    /// * `self` - A chain object
    ///
    /// # Returns
    /// * String
    ///
    /// # Example
    ///
    /// ```
    /// use chainder as chain;
    ///
    /// let data = chain::Reader::from_file("/path/to/chainfile")?;
    /// let line = data.get(&12).unwrap().header();
    /// println!("{:?}", line);
    ///
    /// > "chain 4900 chrY 58368225 + 25985403 25985638 chr5 151006098 - 43257292 43257528 12";
    /// ```
    pub fn header(&self) -> String {
        format!(
            "chain {} {} {} {}",
            self.score,
            self.refs.to_string(),
            self.query.to_string(),
            self.id
        )
    }

    /// Get the alignment of a chain object as a string.
    ///
    /// # Arguments
    /// * `self` - A chain object
    ///
    /// # Returns
    /// * String
    ///
    /// # Example
    ///
    /// ```
    /// use chainder as chain;
    ///
    /// let data = chain::Reader::from_file("/path/to/chainfile")?;
    /// let line = data.get(&12).unwrap().alignment();
    /// println!("{:?}", line);
    ///
    /// > "9\t1\t0";
    /// ```
    pub fn alignment(&self) -> String {
        self.alignment
            .iter()
            .map(|a| a.to_string())
            .collect::<Vec<String>>()
            .join("\n")
    }

    /// Get the alignment of a chain object as a vector of vectors.
    /// The inner vector contains the size, dt, and dq values.
    ///
    /// # Arguments
    /// * `self` - A chain object
    ///
    /// # Returns
    /// * Vec<Vec<u32>>
    ///
    /// # Example
    ///
    /// ```
    /// use chainder as chain;
    ///
    /// let data = chain::Reader::from_file("/path/to/chainfile")?;
    /// let line = data.get(&12).unwrap().alignment_vec();
    /// println!("{:?}", line);
    ///
    /// > [[9, 1, 0]];
    /// ```
    pub fn alignment_vec(&self) -> Vec<Vec<u32>> {
        self.alignment
            .iter()
            .map(|a| vec![a.size, a.dt, a.dq])
            .collect()
    }

    /// Get the chain object as a byte array.
    ///
    /// # Arguments
    /// * `self` - A chain object
    ///
    /// # Returns
    /// * Vec<u8>
    ///
    /// # Example
    ///
    /// ```
    /// use chainder as chain;
    ///
    /// let data = chain::Reader::from_file("/path/to/chainfile")?;
    /// let line = data.get(&12).unwrap().to_bytes();
    /// println!("{:?}", line);
    ///
    /// > [99, 104, 97, 105, 110, 32, 52, 57, 48, 48, 32, 99, 104, 114, 89, 32, 53, 56, 51,
    /// 54, 56, 50, 50, 53, 32, 43, 32, 50, 53, 57, 56, 53, 52, 48, 51, 32, 50, 53, 57, 56,
    /// 53, 54, 51, 56, 32, 99, 104, 114, 53, 32, 49, 53, 49, 48, 48, 54, 48, 57, 56, 32,
    /// 45, 32, 52, 51, 49, 54, 52, 48, 51, 50, 57, 50, 32, 52, 51, 49, 54, 52, 48, 51, 53,
    /// 50, 56, 32, 49, 50, 10, 57, 9, 49, 9, 48, 10];
    /// ```
    pub fn to_bytes(&self) -> Vec<u8> {
        self.to_string().as_bytes().to_vec()
    }

    fn head(header: &[u8]) -> (i64, ChainHead, ChainHead, u32) {
        let mut acc = vec![];
        let mut header = &header[..];
        loop {
            let Some(sep) = memchr(b' ', header) else {
                acc.push(header);
                break;
            };
            acc.push(&header[..sep]);
            header = &header[sep + 1..];
        }

        let refs = ChainHead::from(&acc[2..7]);
        let query = ChainHead::from(&acc[7..12]);

        unsafe {
            let score = from_utf8_unchecked(acc[1]).parse::<i64>().unwrap();
            let id = from_utf8_unchecked(acc.last().unwrap())
                .parse::<u32>()
                .unwrap();

            return (score, refs, query, id);
        }
    }
}

You are an expert Rust programmer. Could you please review it? The main goal is to make it the fastest, most efficient and well build library. Provide your improvements as code.