1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use may_clack::{error::ClackError, input, intro, outro};
use owo_colors::OwoColorize;
use std::fmt::Display;

struct Name;

impl Display for Name {
	fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
		write!(f, "display")
	}
}

fn main() -> Result<(), ClackError> {
	println!();
	intro!(" to_string ".reversed());

	let int = input("int").initial_value(23).parse::<i32>()?;
	let unit = input("struct").placeholder(Name).required()?;

	outro!();

	println!("int {:?}", int);
	println!("unit {:?}", unit);

	Ok(())
}