mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
internal: reduce coupling
tt is a data structure, data structures cant' go wrong, they shouldn't have the knowledge that the world outside of them has all kinds of errors.
This commit is contained in:
parent
d8a3d6f378
commit
81602f8a5d
6 changed files with 25 additions and 32 deletions
|
|
@ -274,18 +274,3 @@ impl Subtree {
|
|||
}
|
||||
|
||||
pub mod buffer;
|
||||
|
||||
#[derive(Debug, PartialEq, Eq, Clone)]
|
||||
pub enum ExpansionError {
|
||||
Unknown(String),
|
||||
ExpansionError(String),
|
||||
}
|
||||
|
||||
impl fmt::Display for ExpansionError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match self {
|
||||
ExpansionError::Unknown(e) => e.fmt(f),
|
||||
ExpansionError::ExpansionError(e) => write!(f, "proc macro returned error: {}", e),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue