user_agent_parser/models/
cpu.rs

1use std::borrow::Cow;
2
3#[derive(Debug, Clone, Default)]
4#[allow(clippy::upper_case_acronyms)]
5pub struct CPU<'a> {
6    pub architecture: Option<Cow<'a, str>>,
7}
8
9impl<'a> CPU<'a> {
10    /// Extracts the owned data.
11    #[inline]
12    pub fn into_owned(self) -> CPU<'static> {
13        let architecture = self.architecture.map(|c| Cow::from(c.into_owned()));
14
15        CPU {
16            architecture,
17        }
18    }
19}