提交 9e65ff31 authored 作者: Serhij S's avatar Serhij S

state params fix

上级 1740486c
...@@ -36,7 +36,7 @@ pub fn load<S: DeserializeOwned, P: AsRef<Path>>(path: P) -> Result<S> { ...@@ -36,7 +36,7 @@ pub fn load<S: DeserializeOwned, P: AsRef<Path>>(path: P) -> Result<S> {
/// Save the state to a file. If "json" extension is specified, the state is saved in JSON /// Save the state to a file. If "json" extension is specified, the state is saved in JSON
/// format. Otherwise it is saved in MessagePack format. /// format. Otherwise it is saved in MessagePack format.
pub fn save<S: Serialize, P: AsRef<Path>>(state: &S, path: P) -> Result<()> { pub fn save<S: Serialize, P: AsRef<Path>>(path: P, state: &S) -> Result<()> {
let format = Format::from_path(&path); let format = Format::from_path(&path);
let mut file = File::create(&path)?; let mut file = File::create(&path)?;
let data = match format { let data = match format {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论