diff --git a/CHANGELOG.md b/CHANGELOG.md index dd049d5..36a68f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -86,5 +86,13 @@ - **BREAKING** Added Python-esque support for `:` as a delimiter. - :new: Add support for case-sensitive maps with automatic handling under the hood. - :hammer: Fixed buggy setters which went uncaught, to preserve case-insensitive nature. +- 2.0.1 + - Add first-class support for setting, loading and reading defaults + - New available struct `IniDefault` for fast templating +- 2.1.0 + - 😯 **BREAKING** Parse keys with higher priority, both brackets `[` and `]` can be part of values now. + - β„Ή Only affects current behaviour **iff** your section headers had comments in front of them like, `comment[HEADER]`, you can fix it by adding the comment after the header like `[HEADER]#comment` or otherwise. + - πŸš€ `load()` and `write()` work with `Path`-like arguments now. + - πŸ“œ Add docs for new struct Older changelogs are preserved here, current changelog is present in [README.md](README.md). diff --git a/LICENSE-LGPL b/LICENSE-LGPL index be63be0..05f78f2 100644 --- a/LICENSE-LGPL +++ b/LICENSE-LGPL @@ -1,4 +1,4 @@ -Copyright (c) 2023 QEDK +Copyright (c) 2024 QEDK GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 diff --git a/LICENSE-MIT b/LICENSE-MIT index 82e99b7..2a5884c 100644 --- a/LICENSE-MIT +++ b/LICENSE-MIT @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 QEDK +Copyright (c) 2024 QEDK Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated diff --git a/README.md b/README.md index e7f55c6..1964c9f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # configparser -[![Build Status](https://github.com/QEDK/configparser-rs/actions/workflows/rust.yaml/badge.svg)](https://github.com/QEDK/configparser-rs/actions/workflows/rust.yaml) [![Crates.io](https://img.shields.io/crates/l/configparser?color=black)](LICENSE-MIT) [![Crates.io](https://img.shields.io/crates/v/configparser?color=black)](https://crates.io/crates/configparser) [![Released API docs](https://docs.rs/configparser/badge.svg)](https://docs.rs/configparser) [![Maintenance](https://img.shields.io/maintenance/yes/2023)](https://github.com/QEDK/configparser-rs) +[![Build Status](https://github.com/QEDK/configparser-rs/actions/workflows/rust.yaml/badge.svg)](https://github.com/QEDK/configparser-rs/actions/workflows/rust.yaml) [![Crates.io](https://img.shields.io/crates/l/configparser?color=black)](LICENSE-MIT) [![Crates.io](https://img.shields.io/crates/v/configparser?color=black)](https://crates.io/crates/configparser) [![Released API docs](https://docs.rs/configparser/badge.svg)](https://docs.rs/configparser) [![Maintenance](https://img.shields.io/maintenance/yes/2024)](https://github.com/QEDK/configparser-rs) This crate provides the `Ini` struct which implements a basic configuration language which provides a structure similar to what’s found in Windows' `ini` files. You can use this to write Rust programs which can be customized by end users easily. @@ -29,7 +29,7 @@ strings as well as files. You can install this easily via `cargo` by including it in your `Cargo.toml` file like: ```TOML [dependencies] -configparser = "3.0.3" +configparser = "3.0.4" ``` ## βž• Supported datatypes @@ -176,16 +176,16 @@ The `Ini` struct offers great support for type conversion and type setting safel You can activate it by adding it as a feature like this: ```TOML [dependencies] -configparser = { version = "3.0.2", features = ["indexmap"] } +configparser = { version = "3.0.4", features = ["indexmap"] } ``` - - *async-std*: Activating the `async-std` feature adds asynchronous functions for reading from (`load_async()`) and - writing to (`write_async()`) files using [async-std](https://crates.io/crates/async-std). + - *tokio*: Activating the `tokio` feature adds asynchronous functions for reading from (`load_async()`) and + writing to (`write_async()`) files using [tokio](https://crates.io/crates/tokio). You can activate it by adding it as a feature like this: ```TOML [dependencies] -configparser = { version = "3.0.2", features = ["async-std"] } +configparser = { version = "3.0.4", features = ["tokio"] } ``` ## πŸ“œ License @@ -206,14 +206,6 @@ additional terms or conditions. ## πŸ†• Changelog Old changelogs are in [CHANGELOG.md](CHANGELOG.md). -- 2.0.1 - - Add first-class support for setting, loading and reading defaults - - New available struct `IniDefault` for fast templating -- 2.1.0 - - 😯 **BREAKING** Parse keys with higher priority, both brackets `[` and `]` can be part of values now. - - β„Ή Only affects current behaviour **iff** your section headers had comments in front of them like, `comment[HEADER]`, you can fix it by adding the comment after the header like `[HEADER]#comment` or otherwise. - - πŸš€ `load()` and `write()` work with `Path`-like arguments now. - - πŸ“œ Add docs for new struct - 3.0.0 - πŸ˜… **BREAKING** `IniDefault` is now a non-exhaustive struct, this will make future upgrades easier and non-breaking in nature. This change might also have a few implications in updating your existing codebase, please read the [official docs](https://doc.rust-lang.org/reference/attributes/type_system.html#the-non_exhaustive-attribute) for more guidance. - `IniDefault` is now internally used for generating defaults, reducing crate size. @@ -226,10 +218,14 @@ Old changelogs are in [CHANGELOG.md](CHANGELOG.md). - Adds support for multi-line key-value pairs. - Adds `async-std` feature for asynchronous file operations. - Some performance optimizations. -- 3.0.3 (**STABLE**) +- 3.0.3 - Add default empty line on empty strings. - Feature to append to existing `Ini` objects. - Minor lint fixes. +- 3.0.4 (**STABLE**) + - Adds pretty printing functionality + - Replaces `async-std` with `tokio` as the available async runtime + - *The `async-std` feature will be deprecated in a future release* ### πŸ”œ Future plans diff --git a/src/ini.rs b/src/ini.rs index e573c39..6929551 100644 --- a/src/ini.rs +++ b/src/ini.rs @@ -5,6 +5,8 @@ use indexmap::IndexMap as Map; #[cfg(not(feature = "indexmap"))] use std::collections::HashMap as Map; +#[deprecated(since = "3.0.4", + note="async-std runtime has been replaced with tokio")] #[cfg(feature = "async-std")] #[cfg(feature = "tokio")] use tokio::fs as async_fs; diff --git a/tests/test.rs b/tests/test.rs index 1149c96..ce71c49 100644 --- a/tests/test.rs +++ b/tests/test.rs @@ -1,4 +1,4 @@ -use configparser::ini::{Ini}; +use configparser::ini::{Ini, WriteOptions}; use std::error::Error; #[test]