mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-15 06:33:58 +00:00
Add default implementation for HirWrite
methods
This commit is contained in:
parent
b517aeeca5
commit
104d707d6a
1 changed files with 4 additions and 11 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue