reverse_tool 0.1.0

A CLI tool to reverse a string.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use clap::Parser;

/// Reverse a string
#[derive(Parser)]
pub struct Cli {
    /// The string to reverse
    pub string: String,
}

pub fn run(cli: Cli) {
    let reversed: String = cli.string.chars().rev().collect();
    println!("Reversed string: {}", reversed);
}