RustbeginnercliAI generated

Temperature Converter CLI with Clap

Build a small command-line utility that converts temperatures between Celsius, Fahrenheit, and Kelvin, using the clap crate for argument parsing and proper error handling for invalid input. Learners practice Rust's Result/Option types, pattern matching, and building a polished CLI with clap derive macros.

Estimate
~5.5h
Steps
4
Completed by
0
Proposed by
codeseed.app

clap

Project roadmap

  1. 01

    Set up clap argument parsing

    ~1h

    Define a clap struct with derive macros for value, source unit, and target unit arguments.

  2. 02

    Implement conversion functions

    ~1.5h

    Write functions for each conversion pair, returning Result to handle invalid combinations.

  3. 03

    Wire up error handling

    ~1.5h

    Use Rust's Result and the ? operator to propagate parsing and conversion errors with clear messages.

  4. 04

    Add tests for all conversion paths

    ~1.5h

    Write unit tests covering every combination of source/target unit including round-trip conversions.

Resources

Ready to build this?

Get a GitHub repo and start building. Your AI reviewer checks each step as you go.

~5.5h · 4 steps

Tech stack

clap