diff options
Diffstat (limited to 'src/source_unit.rs')
-rw-r--r-- | src/source_unit.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/source_unit.rs b/src/source_unit.rs index 9c51ccb..28cc854 100644 --- a/src/source_unit.rs +++ b/src/source_unit.rs @@ -118,6 +118,17 @@ impl SourceUnit { } } +impl PartialEq for SourceUnit { + fn eq(&self, other: &SourceUnit) -> bool { + if let Ok(this_path) = self.main.path.canonicalize() { + if let Ok(other_path) = other.main.path.canonicalize() { + return this_path == other_path; + } + } + return false; + } +} + pub struct SourceFile { pub path: PathBuf, |