Skip to content

Commit

Permalink
update theme
Browse files Browse the repository at this point in the history
  • Loading branch information
vita-dounai committed Nov 20, 2020
1 parent f45b541 commit eee7862
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions docs/quick_start/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ Hello World合约的完整Liquid代码如下:
#![cfg_attr(not(feature = "std"), no_std)]
use liquid_lang as liquid;
#[macro_use]
extern crate alloc;
#[liquid::contract(version = "0.1.0")]
mod hello_world {
use liquid_core::storage;
Expand All @@ -72,7 +69,7 @@ Hello World合约的完整Liquid代码如下:
}
pub fn get(&self) -> String {
format!("Hello, {}!", self.name.clone())
self.name.clone()
}
pub fn set(&mut self, name: String) {
Expand All @@ -86,15 +83,15 @@ Hello World合约的完整Liquid代码如下:
#[test]
fn get_works() {
let contract = HelloWorld::new();
assert_eq!(contract.get(), String::from("Hello, Alice!"));
assert_eq!(contract.get(), String::from("Alice"));
}
#[test]
fn set_works() {
let mut contract = HelloWorld::new();
let new_name = String::from("Bob");
contract.set(new_name.clone());
assert_eq!(contract.get(), format!("Hello, {}!", new_name));
assert_eq!(contract.get(), new_name));
}
}
}
Expand Down

0 comments on commit eee7862

Please sign in to comment.