← All Workshops

MudEngine Part 7: Save & Load

Step 5 / 17

Format Game.toml with taplo

In Part 1 we installed taplo, the TOML formatter. Think of it as rustfmt for .toml files — it normalises indentation, spacing, and key ordering so the world file stays tidy as it grows.

Run it on the file we just created:

Format Game.toml
taplo format Game.toml
Verify it parses cleanly
taplo check Game.toml
💡 Why format a file we just wrote?

On a freshly pasted file taplo format is usually a no-op — the TOML is already tidy. The real payoff comes later:

  • Game.toml is the file you will hand-edit as the world grows (new rooms, items, quests) in later parts. taplo format keeps it uniform after every manual change so diffs stay readable
  • Players.toml is rewritten by the server (toml::to_string_pretty), but if you ever open it to debug a save, formatting it before diffing makes the change obvious

taplo also ships taplo lint for catching style issues and a language server (taplo lsp) that auto-formats on save in VS Code and other editors.

Step 5 / 17