mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-01-01 16:29:18 +00:00
Complete test4
This commit is contained in:
parent
d6a79f2399
commit
9521266b58
@ -5,6 +5,13 @@
|
|||||||
|
|
||||||
// Write a macro that passes the test! No hints this time, you can do it!
|
// Write a macro that passes the test! No hints this time, you can do it!
|
||||||
|
|
||||||
|
#[macro_export]
|
||||||
|
macro_rules! my_macro {
|
||||||
|
($x:expr) => {{
|
||||||
|
format!("Hello {}", $x)
|
||||||
|
}};
|
||||||
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
if my_macro!("world!") != "Hello world!" {
|
if my_macro!("world!") != "Hello world!" {
|
||||||
panic!("Oh no! Wrong output!");
|
panic!("Oh no! Wrong output!");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user