Created
October 25, 2022 02:58
-
-
Save jimluo/8bd9f15777b716af1894cd6e73afc3f3 to your computer and use it in GitHub Desktop.
genesis deserialize, use "DeserializeOwned"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fn read_config_file<T: de::DeserializeOwned>(filename: &str) -> Result<T> { | |
| let f = fs::read_to_string(filename)?; | |
| toml::from_str(&f)? | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment