mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-24 02:53:35 +00:00
internal: improve compilation critical path a bit
This commit is contained in:
parent
0dabcf0044
commit
c639fe333f
7 changed files with 12 additions and 34 deletions
|
@ -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`
|
||||
///
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue