Fix: Pass arguments in right order

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
This commit is contained in:
Matthias Beyer 2023-01-03 15:23:01 +01:00 committed by Scott Boggs
parent 5d445d2708
commit 53447d1f48
1 changed files with 1 additions and 1 deletions

View File

@ -46,7 +46,7 @@ pub fn to_vec(data: &Data) -> Result<Vec<u8>> {
/// Attempts to serialize a Data struct to something that implements the
/// std::io::Write trait
pub fn to_writer<W: Write>(data: &Data, writer: W) -> Result<()> {
Ok(serde_json::to_writer(data, writer)?)
Ok(serde_json::to_writer(writer, data)?)
}
/// Attempts to serialize a Data struct to a file