We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code sample:
#[derive(Clone, Debug, Serialize, Deserialize)] pub struct Config { pub keybindings: Option<String>, #[serde(rename = "clipboard")] pub clipboard: Option<String>, #[serde(rename = "screenshot.filesystem")] pub filesystem: Option<String>, } impl Default for Config { fn default() -> Self { Config { keybindings: Some("hello".to_string()), clipboard: Some("toml".to_string()), filesystem: Some("serde".to_string()), } } } fn main() { let config = Config::default(); let serialized = toml::to_string_pretty(&config).unwrap(); let mut file = File::create("output.toml").unwrap(); file.write_all(serialized.as_bytes()).unwrap(); }
This code produces this output:
keybindings = "hello" clipboard = "toml" "screenshot.filesystem" = "serde"
Not sure if it's serde or toml crate's problem, though...
serde
toml
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Code sample:
This code produces this output:
Not sure if it's
serde
ortoml
crate's problem, though...The text was updated successfully, but these errors were encountered: