Skip to content

Instantly share code, notes, and snippets.

@daboross
Created February 26, 2017 23:56
Show Gist options
  • Save daboross/e1fc9546e7f1a7b87fecc421526a301f to your computer and use it in GitHub Desktop.
Save daboross/e1fc9546e7f1a7b87fecc421526a301f to your computer and use it in GitHub Desktop.
Example of "strange" formatting.
fn main() {
let x = Struct {
a_field: vec![
AnotherStruct {
time_period: 8,
energy_harvested: stats_max.energyHarvested8,
energy_spent_creeps: stats_max.energyCreeps8,
energy_spent_control: stats_max.energyControl8,
energy_spent_construction: stats_max.energyConstruction8,
creep_parts_produced: stats_max.creepsProduced8,
creep_parts_lost: stats_max.creepsLost8,
},
AnotherStruct {
time_period: 180,
energy_harvested: stats_max.energyHarvested180,
energy_spent_creeps: stats_max.energyCreeps180,
energy_spent_control: stats_max.energyControl180,
energy_spent_construction: stats_max.energyConstruction180,
creep_parts_produced: stats_max.creepsProduced180,
creep_parts_lost: stats_max.creepsLost180,
},
AnotherStruct {
time_period: 1440,
energy_harvested: stats_max.energyHarvested1440,
energy_spent_creeps: stats_max.energyCreeps1440,
energy_spent_control: stats_max.energyControl1440,
energy_spent_construction: stats_max.energyConstruction1440,
creep_parts_produced: stats_max.creepsProduced1440,
creep_parts_lost: stats_max.creepsLost1440,
},
],
};
}
fn main() {⏎
let x = Struct {⏎
- total_stats: vec![⏎
- TotalStats {⏎
- time_period: 8,⏎
- energy_harvested: stats_max.energyHarvested8,⏎
- energy_spent_creeps: stats_max.energyCreeps8,⏎
- energy_spent_control: stats_max.energyControl8,⏎
- energy_spent_construction: stats_max.energyConstruction8,⏎
- creep_parts_produced: stats_max.creepsProduced8,⏎
- creep_parts_lost: stats_max.creepsLost8,⏎
- },⏎
- TotalStats {⏎
- time_period: 180,⏎
- energy_harvested: stats_max.energyHarvested180,⏎
- energy_spent_creeps: stats_max.energyCreeps180,⏎
- energy_spent_control: stats_max.energyControl180,⏎
- energy_spent_construction: stats_max.energyConstruction180,⏎
- creep_parts_produced: stats_max.creepsProduced180,⏎
- creep_parts_lost: stats_max.creepsLost180,⏎
- },⏎
- TotalStats {⏎
- time_period: 1440,⏎
- energy_harvested: stats_max.energyHarvested1440,⏎
- energy_spent_creeps: stats_max.energyCreeps1440,⏎
- energy_spent_control: stats_max.energyControl1440,⏎
- energy_spent_construction: stats_max.energyConstruction1440,⏎
- creep_parts_produced: stats_max.creepsProduced1440,⏎
- creep_parts_lost: stats_max.creepsLost1440,⏎
- }⏎
- ],⏎
- };⏎
+ total_stats: vec![TotalStats {⏎
+ time_period: 8,⏎
+ energy_harvested: stats_max.energyHarvested8,⏎
+ energy_spent_creeps: stats_max.energyCreeps8,⏎
+ energy_spent_control: stats_max.energyControl8,⏎
+ energy_spent_construction: stats_max.energyConstruction8,⏎
+ creep_parts_produced: stats_max.creepsProduced8,⏎
+ creep_parts_lost: stats_max.creepsLost8,⏎
+ },⏎
+ TotalStats {⏎
+ time_period: 180,⏎
+ energy_harvested: stats_max.energyHarvested180,⏎
+ energy_spent_creeps: stats_max.energyCreeps180,⏎
+ energy_spent_control: stats_max.energyControl180,⏎
+ energy_spent_construction: stats_max.energyConstruction180,⏎
+ creep_parts_produced: stats_max.creepsProduced180,⏎
+ creep_parts_lost: stats_max.creepsLost180,⏎
+ },⏎
+ TotalStats {⏎
+ time_period: 1440,⏎
+ energy_harvested: stats_max.energyHarvested1440,⏎
+ energy_spent_creeps: stats_max.energyCreeps1440,⏎
+ energy_spent_control: stats_max.energyControl1440,⏎
+ energy_spent_construction: stats_max.energyConstruction1440,⏎
+ creep_parts_produced: stats_max.creepsProduced1440,⏎
+ creep_parts_lost: stats_max.creepsLost1440,⏎
+ }],⏎
+ };⏎
}⏎
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment