Settings refactor (#38367)
Co-Authored-By: Ben K <ben@zed.dev> Co-Authored-By: Anthony <anthony@zed.dev> Co-Authored-By: Mikayla <mikayla@zed.dev> Release Notes: - settings: Major internal changes to settings. The primary user-facing effect is that some settings which did not make sense in project settings files are no-longer read from there. (For example the inline blame settings) --------- Co-authored-by: Ben Kunkle <ben@zed.dev> Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com> Co-authored-by: Anthony <anthony@zed.dev>
This commit is contained in:
co-authored by
Ben Kunkle
Mikayla Maki
Anthony
parent
0a9023bce0
commit
fcdab160f9
@@ -1390,3 +1390,21 @@ Line 3"#
|
||||
assert_eq!(result[1], (10..15, "world")); // '🦀' is 4 bytes
|
||||
}
|
||||
}
|
||||
|
||||
pub fn refine<T: Clone>(dest: &mut T, src: &Option<T>) {
|
||||
if let Some(src) = src {
|
||||
*dest = src.clone()
|
||||
}
|
||||
}
|
||||
|
||||
pub trait MergeFrom: Sized + Clone {
|
||||
fn merge_from(&mut self, src: &Option<Self>);
|
||||
}
|
||||
|
||||
impl<T: Clone> MergeFrom for T {
|
||||
fn merge_from(&mut self, src: &Option<Self>) {
|
||||
if let Some(src) = src {
|
||||
*self = src.clone();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user