Skip to content

Commit

Permalink
Document configurable CSV delimiter and bump patch version
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasEi committed Jan 17, 2024
1 parent 8cdd13a commit 9c437a4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "bevy_common_assets"
version = "0.9.0"
version = "0.9.1"
authors = ["Niklas Eicker <git@nikl.me>"]
edition = "2021"
license = "MIT OR Apache-2.0"
Expand Down
15 changes: 15 additions & 0 deletions src/csv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<TreePosition>::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
Expand Down

0 comments on commit 9c437a4

Please sign in to comment.