A world map for rustaceans

I wanted a small project to build while learning rust. saw the zig community user map,, noticed rust didn't have one,, so i made it. it's a map where u can pin your location.

each person is a ferris crab that flips to their github avatar. You add yourself by opening a PR with a small json file (there's a button to pre-fill it for u).

how it works under the hood:

  • a small rust CLI validates the json files (checks if name matches file,, coords in bounds) and builds the site data.

  • github actions run the CLI and deploy the page on push.

  • map is leaflet + openstreetmap.

seeded it with 30+ community members to start. I also plan to add rust events to this map in the future.

map: Rust Community Map

repo: GitHub - Andrew-Velox/rust-user-map · GitHub

Im still fairly new to rust so id appreciate feedback .

p.s. the map interface was generated because i really don't like frontend and just want to focus strictly on rust. if you have any recommendations on how I can improve my rust skills and learn rust more efficiently,, I'd love to hear your advice! drop a pin if you want to be on the map!

Oh how fun.

Look what I found while pointing and clicking.
m.ou.se does magic with their contributions.

hahaha,, you really have a sharp eye :folded_hands:

Very cute!

There isn't much Rust to review, I'm afraid :sweat_smile:

With clap, you can add doc comments (3 times /) to your Cli struct and Commands enum variants, so that when you run your app with the --help flag, it gives helpful output with description on what each command does.

If you want your code to be more "production-like", you could define your own error enum (eg: MyError (but pls find a better name)), and use Result<T, MyError> rather than Result<T, String>, and implement std::error::Error and std::fmt::Display on MyError.

Or alternatively use an ergonomic error crate like anyhow or eyre.

if your main function returns a Result, you don't need to manually match on errors to display the error message and exiting with the relevant exit code, just use ?. The error handler will do the work for you.

thanks for the tips! i had no idea clap picked up doc comments like that,, definitely adding those. and i actually read about anyhow and the ? operator in the rust book,, idk why i didnt use them on this project yet lol. really appreciate the review! :blush:

i changed the map ui from 2d to a 3d globe,, does this look better?

I don't know. It is nice, very nice. But better, I am not sure.

Because you did the work for both, I think better would be a way to choose 2d or 3d.

My personal opinion is the 3d looks better.
I think navigating on the 2d is better.

yeah, 3d navigation definitely has its drawbacks. I originally tried to include both the 2d and 3d maps, but because im using a single HTML file, i thought it would be simpler to manage just one for now. I'm hoping to keep both the 2d and 3d options in the future though! :grinning_face_with_smiling_eyes: