diff options
author | Jonas Schievink <[email protected]> | 2020-12-19 01:43:00 +0000 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2020-12-19 01:43:00 +0000 |
commit | 81ccf37d3b8a5ffdf5c2d537761eeb06ae29dd7e (patch) | |
tree | 7a32c4fcf9b173fd7540b2ed2994dc8b1edbdcec /crates/hir_def | |
parent | e47e7a0143a537ef76b0f946dfc3ec56ed2e0507 (diff) |
Remove `Attrs::merge`
Only the `RawAttrs` version of this is in use
Diffstat (limited to 'crates/hir_def')
-rw-r--r-- | crates/hir_def/src/attr.rs | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/crates/hir_def/src/attr.rs b/crates/hir_def/src/attr.rs index d1ed23947..aacfeef28 100644 --- a/crates/hir_def/src/attr.rs +++ b/crates/hir_def/src/attr.rs | |||
@@ -241,18 +241,6 @@ impl Attrs { | |||
241 | raw_attrs.filter(db, def.krate(db)) | 241 | raw_attrs.filter(db, def.krate(db)) |
242 | } | 242 | } |
243 | 243 | ||
244 | pub fn merge(&self, other: Attrs) -> Attrs { | ||
245 | match (&self.0.entries, &other.0.entries) { | ||
246 | (None, None) => Attrs::EMPTY, | ||
247 | (Some(entries), None) | (None, Some(entries)) => { | ||
248 | Attrs(RawAttrs { entries: Some(entries.clone()) }) | ||
249 | } | ||
250 | (Some(a), Some(b)) => { | ||
251 | Attrs(RawAttrs { entries: Some(a.iter().chain(b.iter()).cloned().collect()) }) | ||
252 | } | ||
253 | } | ||
254 | } | ||
255 | |||
256 | pub fn by_key(&self, key: &'static str) -> AttrQuery<'_> { | 244 | pub fn by_key(&self, key: &'static str) -> AttrQuery<'_> { |
257 | AttrQuery { attrs: self, key } | 245 | AttrQuery { attrs: self, key } |
258 | } | 246 | } |