test_repo

As usual, I test everything with cats
README | Files | Log | Refs

commit 7800a5bc06419255be1410926971f74d9c34c651
parent 906b2d4a1bbb65837fff5b1531f8b4ff27f6ca1d
Author: nindwen <me@nindwen.blue>
Date:   Wed,  6 Jun 2018 18:03:09 +0300

simpler function pointer

Diffstat:
src/main.rs | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/main.rs b/src/main.rs @@ -1,6 +1,6 @@ -struct FunktionaalinenKissa<'a> { +struct FunktionaalinenKissa { command: String, - action: &'a Fn(i32) -> i32, + action: fn(i32) -> i32, } // Meows fn miau() -> &'static str { @@ -14,7 +14,7 @@ fn huu(n: i32) -> i32 { fn main() { let cmd = FunktionaalinenKissa { command: "moi".to_string(), - action: &huu, + action: huu, }; println!("Hello, {} world!", miau()); println!("Hello, {} world times {}!", cmd.command, (cmd.action)(2));