https://github.com/byron/hotel-reservations
An implementation of the hotel reservations coding challenge in Rust the way I would love to see it
https://github.com/byron/hotel-reservations
Last synced: 11 months ago
JSON representation
An implementation of the hotel reservations coding challenge in Rust the way I would love to see it
- Host: GitHub
- URL: https://github.com/byron/hotel-reservations
- Owner: Byron
- Created: 2018-05-27T07:23:05.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-27T17:23:48.000Z (about 8 years ago)
- Last Synced: 2025-04-06T08:36:46.853Z (over 1 year ago)
- Language: Rust
- Size: 53.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Goal
Solve the hotel reservations problem the way I would like it, in Rust.
Try to be as idiomatic as possible, and consider the answer the main user
value to provide. Thus that and only that MUST be tested, anything else
is 'extra', like actually testing for a few things the user can run into.
## Getting the answers
Run `make answers` if your `rust` installation is at least at v1.26.
If you have no `rust` but `docker`, run `make answers-in-docker`.
In any case, you can run all `make` targets using docker via `make interactive-developer-environment-in-docker`.
Please be warned that initial compilation takes a while.
## Features
* [x] shows correct answers
* [x] fully streaming with minimal state
* [x] strict overflow checking for all computations
* [x] support for profiling
* [x] support for benchmarking
* [x] support for linting
* [x] interactive developer environment in docker
## Notes
* regex are explicitly not used for parsing, which would remove a few lines of code at the expense
of a huge dependency.
* There are plenty of unused fields which are implemented only for completeness. Also I believe
they are optimized away to the point where the they are not actually parsed.
## Benchmark Results
The Rust implementation comes in at 213 lines, with a binary sized at 780kb (stripped). It runs the benchmark
in 54ms.