Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use csv::{QuoteStyle, WriterBuilder}; // 1.1.1
- use serde; // 1.0.97
- use std::io;
- #[derive(serde::Serialize)]
- struct Dummy {
- abc: String,
- def: f64,
- }
- fn main() {
- let mut wrt = WriterBuilder::new()
- .quote_style(QuoteStyle::NonNumeric)
- .from_writer(io::stdout());
- wrt.serialize(Dummy {
- abc: "1.01".to_string(),
- def: 1.01,
- }).unwrap();
- wrt.serialize(Dummy {
- abc: "1.01.01".to_string(),
- def: 1.01,
- }).unwrap();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement