(
&mut self,
var_name: &str,
default: &Option<(Value, Span)>,
is_cloud: bool,
comma: &mut bool,
)
| 685 | } |
| 686 | |
| 687 | pub fn json_var_declaration( |
| 688 | &mut self, |
| 689 | var_name: &str, |
| 690 | default: &Option<(Value, Span)>, |
| 691 | is_cloud: bool, |
| 692 | comma: &mut bool, |
| 693 | ) -> io::Result<()> { |
| 694 | write_comma_io(&mut self.zip, comma)?; |
| 695 | let default = match default { |
| 696 | Some((value, _)) => value.to_string(), |
| 697 | None => arcstr::literal!("0"), |
| 698 | }; |
| 699 | if is_cloud { |
| 700 | write!( |
| 701 | self, |
| 702 | "\"{}\":[\"\u{2601} {}\",{default},true]", |
| 703 | var_name, var_name |
| 704 | ) |
| 705 | } else { |
| 706 | write!(self, "\"{}\":[\"{}\",{default}]", var_name, var_name) |
| 707 | } |
| 708 | } |
| 709 | |
| 710 | pub fn var_declaration(&mut self, s: S, var: &Var, comma: &mut bool, d: D) -> io::Result<()> { |
| 711 | match &var.type_ { |
no test coverage detected