Move all crates to a top-level crates folder
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
parent
d768224182
commit
fdfed3d7db
282 changed files with 195588 additions and 16 deletions
15
crates/gpui/src/json.rs
Normal file
15
crates/gpui/src/json.rs
Normal file
|
@ -0,0 +1,15 @@
|
|||
pub use serde_json::*;
|
||||
|
||||
pub trait ToJson {
|
||||
fn to_json(&self) -> Value;
|
||||
}
|
||||
|
||||
impl<T: ToJson> ToJson for Option<T> {
|
||||
fn to_json(&self) -> Value {
|
||||
if let Some(value) = self.as_ref() {
|
||||
value.to_json()
|
||||
} else {
|
||||
json!(null)
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue