internal: improve compilation critical path a bit

This commit is contained in:
Aleksey Kladov 2021-08-28 22:03:06 +03:00
parent 0dabcf0044
commit c639fe333f
7 changed files with 12 additions and 34 deletions

View file

@ -66,27 +66,6 @@ impl PartialEq<AbsPath> for AbsPathBuf {
}
}
impl serde::Serialize for AbsPathBuf {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
self.0.serialize(serializer)
}
}
impl<'de> serde::Deserialize<'de> for AbsPathBuf {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let path = PathBuf::deserialize(deserializer)?;
AbsPathBuf::try_from(path).map_err(|path| {
serde::de::Error::custom(format!("expected absolute path, got {}", path.display()))
})
}
}
impl AbsPathBuf {
/// Wrap the given absolute path in `AbsPathBuf`
///