diff options
author | Seivan Heidari <[email protected]> | 2019-11-28 07:19:14 +0000 |
---|---|---|
committer | Seivan Heidari <[email protected]> | 2019-11-28 07:19:14 +0000 |
commit | 18a0937585b836ec5ed054b9ae48e0156ab6d9ef (patch) | |
tree | 9de2c0267ddcc00df717f90034d0843d751a851b /crates/ra_hir/src/util.rs | |
parent | a7394b44c870f585eacfeb3036a33471aff49ff8 (diff) | |
parent | 484acc8a61d599662ed63a4cbda091d38a982551 (diff) |
Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into feature/themes
Diffstat (limited to 'crates/ra_hir/src/util.rs')
-rw-r--r-- | crates/ra_hir/src/util.rs | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/crates/ra_hir/src/util.rs b/crates/ra_hir/src/util.rs deleted file mode 100644 index 0095ee45d..000000000 --- a/crates/ra_hir/src/util.rs +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | //! Internal utility functions. | ||
2 | |||
3 | use std::sync::Arc; | ||
4 | |||
5 | /// Helper for mutating `Arc<[T]>` (i.e. `Arc::make_mut` for Arc slices). | ||
6 | /// The underlying values are cloned if there are other strong references. | ||
7 | pub(crate) fn make_mut_slice<T: Clone>(a: &mut Arc<[T]>) -> &mut [T] { | ||
8 | if Arc::get_mut(a).is_none() { | ||
9 | *a = a.iter().cloned().collect(); | ||
10 | } | ||
11 | Arc::get_mut(a).unwrap() | ||
12 | } | ||