const DOWNLOAD: &str = "download:";
const SOURCE: &str = "source:";
#[derive(Default)]
pub enum Feature {
#[default]
Default,
Download,
Source,
}
impl Feature {
pub fn parse(request: &str) -> (Self, &str) {
if let Some(postfix) = request.strip_prefix(DOWNLOAD) {
return (Self::Download, postfix);
}
if let Some(postfix) = request.strip_prefix(SOURCE) {
return (Self::Source, postfix);
}
(Self::Default, request)
}
}