This Rust application, Date Difference Calculator
, provides a simple command-line utility to calculate the exact number of days between two dates. It uses the chrono
crate for date parsing and calculation.
- β Takes input dates in YYYY-MM-DD format
- β Automatically handles date order (earlier/later doesn't matter)
- β Displays the exact number of days between the dates
Enter Two dates in YYYYMMDD format
Enter the First Date: 2023-05-10
Enter the Second Date: 2023-12-25
There is difference of 229 days
- Run the program
- Enter two dates when prompted (YYYY-MM-DD format)
- View the difference in days between the dates
- π¦ chrono: For date parsing and calculation
Here is a sample code url
This Rust application, Todo CLI
, is a command-line task manager that helps you track your to-do items with deadlines. It offers a simple but effective interface for managing daily tasks.
- β Add new tasks with title, description, and deadline
- β List all tasks with their details
- β Mark tasks as complete
- β Simple menu-driven interface
The application provides a menu with the following options:
- Add Task - Create a new task
- List Tasks - View all tasks
- Mark Task as Complete - Update task status
- Exit - Close the application
- π¦ chrono: For date handling
- π¦ Standard Rust libraries for I/O
Here is a sample code url
This Rust application, LogsGenerator
, demonstrates a basic asynchronous file writing process using the tokio
runtime. It concurrently writes simple messages to two separate files: main.txt
and log.log
. The log.log
file includes timestamps for each entry, providing a basic logging mechanism.
- β Creates both content and log files
- β Asynchronously writes to files for better performance
- β Timestamps each log entry
- β Demonstrates Rust's async/await capabilities
main.txt:
hello brother 1
hello brother 2
hello brother 3
...
log.log:
[12:39:48] [2025-05-09] -> Log.1. Appended Successfully
[12:39:48] [2025-05-09] -> Log.2. Appended Successfully
[12:39:48] [2025-05-09] -> Log.3. Appended Successfully
...
- Uses Tokio runtime for async operations
- Appends to existing files or creates them if they don't exist
- Generates 99 log entries with timestamps
- π¦ tokio: For asynchronous I/O operations
- π¦ chrono: For timestamp generation
Here is a sample code url
This Rust application, MathQuiz
, is a small command-line math quiz that tests your mental arithmetic using randomly generated questions and tracks how fast and accurately you answer.
- β Randomly generates 5 math problems using +, -, *, /
- β
Uses
eval
crate to compute expressions dynamically - β Times the total duration taken to solve
- β Provides final score out of 5
- Run the application
- Solve 5 math problems as quickly as possible
- Get score and time summary
- π¦ eval: For evaluating math expressions
- π¦ rand: For generating random numbers and operations
- π¦ std: For I/O and timing utilities
Here is a sample code url
This Rust application, Terminal Todo Viewer
, creates a simple Text-based User Interface (TUI) using the ratatui
and crossterm
crates. It allows users to input, display, and manage a todo list interactively from the terminal.
- β Add items to a list dynamically
- β View all added items in a scrollable interface
- β
Use
"clear"
command to reset the list - β Real-time terminal updates without pressing Enter for every input
- Run the application in terminal
- Type to add a new list item; press
Enter
to submit - Type
clear
and pressEnter
to clear the list - Press
q
to quit the application
let lines = alllist
.iter()
.enumerate()
.map(|(i, s)| Line::from(format!("{}. {}", i + 1, s)))
.collect::<Vec<_>>();
let paragraph1 = Paragraph::new(Text::from(lines)).block(
Block::default().title(" Total Lists ").borders(Borders::ALL),
);
let paragraph2 = Paragraph::new(Line::from(input_text.clone())).block(
Block::default().title("Add new List ------ Enter 'clear' to Clear ").borders(Borders::ALL),
);