From 9c437a4527cdca865c265b3fc5741b091c10b12f Mon Sep 17 00:00:00 2001 From: Niklas Eicker Date: Wed, 17 Jan 2024 22:27:10 +0100 Subject: [PATCH] Document configurable CSV delimiter and bump patch version --- CHANGELOG.md | 3 +++ Cargo.toml | 2 +- src/csv.rs | 15 +++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index be56542..c1e9b9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## v0.9.1 - 17.01.2024 +- CsvAssetPlugin supports configuring the delimiter with `with_delimiter` + ## v0.9.0 - 07.01.2024 - Add support for CSV files diff --git a/Cargo.toml b/Cargo.toml index 94aea22..691b8c7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bevy_common_assets" -version = "0.9.0" +version = "0.9.1" authors = ["Niklas Eicker "] edition = "2021" license = "MIT OR Apache-2.0" diff --git a/src/csv.rs b/src/csv.rs index 28dd3f6..c7eaa3b 100644 --- a/src/csv.rs +++ b/src/csv.rs @@ -41,6 +41,21 @@ where } /// Change the delimiter used to parse the CSV file. + /// + /// The default is "," + /// + /// ```no_run + /// # use bevy::prelude::*; + /// # use bevy_common_assets::csv::CsvAssetPlugin; + /// App::new() + /// .add_plugins(CsvAssetPlugin::::new(&["some_file.csv"]).with_delimiter(b';')); + /// # #[derive(serde::Deserialize, Asset, TypePath, Debug)] + /// # struct TreePosition { + /// # x: f32, + /// # y: f32, + /// # z: f32, + /// # } + /// ``` pub fn with_delimiter(mut self, delimiter: u8) -> Self { self.delimiter = delimiter; self