use rabbitsay::{Config, say, say_with};
fn main() {
println!("=== Simple API (recommended) ===\n");
let output = say("Hello from rabbitsay! This is the easiest way to use the library.");
println!("{}", output);
println!("\n=== Custom Configuration ===\n");
let config = Config {
max_width: 20,
padding: 2,
};
let output = say_with(
"This is a longer message that will be wrapped at 20 characters!",
config,
);
println!("{}", output);
println!("\n=== Different Padding ===\n");
let config = Config {
max_width: 15,
padding: 1,
};
let output = say_with("Compact rabbit says hi!", config);
println!("{}", output);
println!("\n=== Library Usage Example ===\n");
let messages = vec![
say("Error: File not found!"),
say_with(
"Warning: Low disk space",
Config {
max_width: 25,
padding: 3,
},
),
say("Success!"),
];
for (i, msg) in messages.iter().enumerate() {
if i == 1 {
println!("{}", msg);
}
}
}