Doctest,
}
-#[derive(Clone, Copy, Debug, PartialEq, Eq, Deserialize)]
+#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum MessageFormat {
Human,
Json
use std::fmt;
use std::path::Path;
-use serde::{Deserialize, Deserializer};
-use serde::de;
-
use git2::Config as GitConfig;
use git2::Repository as GitRepository;
bin: bool,
}
-impl<'de> Deserialize<'de> for VersionControl {
- fn deserialize<D: Deserializer<'de>>(d: D) -> Result<VersionControl, D::Error> {
- Ok(match &String::deserialize(d)?[..] {
- "git" => VersionControl::Git,
- "hg" => VersionControl::Hg,
- "pijul" => VersionControl::Pijul,
- "fossil" => VersionControl::Fossil,
- "none" => VersionControl::NoVcs,
- n => {
- let value = de::Unexpected::Str(n);
- let msg = "unsupported version control system";
- return Err(de::Error::invalid_value(value, &msg));
- }
- })
- }
-}
-
impl<'a> NewOptions<'a> {
pub fn new(version_control: Option<VersionControl>,
bin: bool,