diff options
| author | Ryo Yoshida <low.ryoshida@gmail.com> | 2023-07-28 19:11:55 +0900 |
|---|---|---|
| committer | Ryo Yoshida <low.ryoshida@gmail.com> | 2023-07-28 19:11:55 +0900 |
| commit | 104d707d6a35b5f3f77c3a7d02a9787daf05547f (patch) | |
| tree | 180a8a4c9b3a80881d1533bab0ef0477a01dc68c | |
| parent | b517aeeca5976955f8f49e8ce3de4bc63cf629c9 (diff) | |
| download | rust-104d707d6a35b5f3f77c3a7d02a9787daf05547f.tar.gz rust-104d707d6a35b5f3f77c3a7d02a9787daf05547f.zip | |
Add default implementation for `HirWrite` methods
| -rw-r--r-- | crates/hir-ty/src/display.rs | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/crates/hir-ty/src/display.rs b/crates/hir-ty/src/display.rs index f53e24c238d..1b4ee4613d6 100644 --- a/crates/hir-ty/src/display.rs +++ b/crates/hir-ty/src/display.rs @@ -48,22 +48,15 @@ use crate::{ }; pub trait HirWrite: fmt::Write { - fn start_location_link(&mut self, location: ModuleDefId); - fn end_location_link(&mut self); + fn start_location_link(&mut self, _location: ModuleDefId) {} + fn end_location_link(&mut self) {} } // String will ignore link metadata -impl HirWrite for String { - fn start_location_link(&mut self, _: ModuleDefId) {} - - fn end_location_link(&mut self) {} -} +impl HirWrite for String {} // `core::Formatter` will ignore metadata -impl HirWrite for fmt::Formatter<'_> { - fn start_location_link(&mut self, _: ModuleDefId) {} - fn end_location_link(&mut self) {} -} +impl HirWrite for fmt::Formatter<'_> {} pub struct HirFormatter<'a> { pub db: &'a dyn HirDatabase, |
