mirror of
https://github.com/fluencelabs/examples
synced 2025-03-16 16:20:50 +00:00
update greeting with bool
This commit is contained in:
parent
2333ded73b
commit
8950cd36d0
@ -1,6 +1,6 @@
|
||||
modules_dir = "artifacts/"
|
||||
|
||||
[[module]]
|
||||
name = "echo-service"
|
||||
name = "greeting"
|
||||
mem_pages_count = 1
|
||||
logger_enabled = false
|
||||
|
@ -5,5 +5,5 @@ mkdir -p artifacts
|
||||
cargo update
|
||||
fce build --release
|
||||
|
||||
rm artifacts/*
|
||||
rm -f artifacts/*.wasm
|
||||
cp target/wasm32-wasi/release/greeting.wasm artifacts/
|
||||
|
@ -22,6 +22,9 @@ module_manifest!();
|
||||
pub fn main() {}
|
||||
|
||||
#[fce]
|
||||
pub fn greeting(name: String) -> String {
|
||||
format!("Hi, {}", name)
|
||||
pub fn greeting(name: String, greeter: bool) -> String {
|
||||
match greeter {
|
||||
true => format!("Hi, {}", name),
|
||||
false => format!("Bye, {}", name),
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user