Skip to content

Commit

Permalink
rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
wez committed Nov 29, 2024
1 parent 74015a9 commit 4906789
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions wezterm-dynamic/derive/src/todynamic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,34 +44,34 @@ fn derive_struct(input: &DeriveInput, fields: &FieldsNamed) -> Result<TokenStrea
let tokens = match info.into {
Some(into) => {
quote!(
impl #impl_generics wezterm_dynamic::ToDynamic for #ident #ty_generics #bounded_where_clause {
fn to_dynamic(&self) -> wezterm_dynamic::Value {
let target: #into = self.into();
target.to_dynamic()
}
impl #impl_generics wezterm_dynamic::ToDynamic for #ident #ty_generics #bounded_where_clause {
fn to_dynamic(&self) -> wezterm_dynamic::Value {
let target: #into = self.into();
target.to_dynamic()
}
)
}
)
}
None => {
quote!(
impl #impl_generics wezterm_dynamic::PlaceDynamic for #ident #ty_generics #bounded_where_clause {
fn place_dynamic(&self, place: &mut wezterm_dynamic::Object) {
#(
#placements
)*
}
impl #impl_generics wezterm_dynamic::PlaceDynamic for #ident #ty_generics #bounded_where_clause {
fn place_dynamic(&self, place: &mut wezterm_dynamic::Object) {
#(
#placements
)*
}
}

impl #impl_generics wezterm_dynamic::ToDynamic for #ident #ty_generics #bounded_where_clause {
fn to_dynamic(&self) -> wezterm_dynamic::Value {
use wezterm_dynamic::PlaceDynamic;
impl #impl_generics wezterm_dynamic::ToDynamic for #ident #ty_generics #bounded_where_clause {
fn to_dynamic(&self) -> wezterm_dynamic::Value {
use wezterm_dynamic::PlaceDynamic;

let mut object = wezterm_dynamic::Object::default();
self.place_dynamic(&mut object);
wezterm_dynamic::Value::Object(object)
}
let mut object = wezterm_dynamic::Object::default();
self.place_dynamic(&mut object);
wezterm_dynamic::Value::Object(object)
}
)
}
)
}
};

Expand Down

0 comments on commit 4906789

Please sign in to comment.