Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update MSRV to 1.70 #33

Merged
merged 2 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
version: ['1.63', 'stable']
dir: ['.', 'tests/test-alloc', 'tests/test-no-std', 'tests/test-std']
version: [ '1.70', 'stable' ]
dir: [ '.', 'tests/test-alloc', 'tests/test-no-std', 'tests/test-std' ]
steps:
- name: Checkout sources
uses: actions/checkout@v4
Expand All @@ -41,7 +41,7 @@ jobs:
override: true

- name: Run cargo test
run: |
run: |
cd ${{ matrix.dir }}
cargo test

Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ members = [
name = "prse"
version = "1.2.0"
edition = "2021"
rust-version = "1.63.0"
rust-version = "1.70.0"
authors = ["miam-miam <[email protected]>"]
documentation = "https://docs.rs/prse/"
license = "MIT OR Apache-2.0"
Expand All @@ -22,7 +22,7 @@ exclude = [".github", "examples", "tests"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
prse-derive = { version = "1.1.1", path="prse-derive", default-features = false }
prse-derive = { version = "1.1.1", path = "prse-derive", default-features = false }
memchr = { version = "2.7.1", default-features = false }

[features]
Expand Down
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Prse is a small string parsing library with an emphasis on speed and ease of use

It provides the [`parse!`] macro which allows you to easily parse strings into any type using a format args like syntax.

<sup>Prse currently supports rustc 1.63 and above.</sup>
<sup>Prse currently supports rustc 1.70 and above.</sup>

[`parse!`]: https://docs.rs/prse/latest/prse/macro.parse.html

Expand Down Expand Up @@ -48,30 +48,31 @@ use prse::try_parse;
use std::path::PathBuf;

let input = "cd C:\\windows\\system32";
let path: Result<PathBuf, _> = try_parse!(input, "cd {}");
let path: Result<PathBuf, _ > = try_parse!(input, "cd {}");

assert_eq!(path.unwrap(), PathBuf::from("C:\\windows\\system32"));
```

Additionally you can use the [`Parse`] derive macro to help you parse custom types.
Additionally you can use the [`Parse`] derive macro to help you parse custom types.
For even more flexibility you can implement the [`Parse`](https://docs.rs/prse/latest/prse/trait.Parse.html)
trait yourself for fully custom parsing such as hexadecimal number parsing.

```rust
use prse::{parse, Parse};

#[derive(Parse, PartialEq, Eq, Debug)]
#[prse = "({x}, {y})"]
struct Position {
x: i32,
struct Position {
x: i32,
y: i32,
}

let input = "(1, 3) + (-2, 9)";

let (lhs, rhs): (Position, Position) = parse!(input, "{} + {}");

assert_eq!(lhs, Position {x: 1, y: 3});
assert_eq!(rhs, Position {x: -2, y: 9});
assert_eq!(lhs, Position { x: 1, y: 3 });
assert_eq!(rhs, Position { x: -2, y: 9 });
```

[`Parse`]: https://docs.rs/prse/latest/prse/derive.Parse.html
Expand Down
2 changes: 1 addition & 1 deletion prse-derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ readme = "../README.md"
description = "A helper macro crate for the prse crate."
keywords = ["string", "parsing", "format-args", "no-std"]
categories = ["parsing"]
rust-version = "1.63.0"
rust-version = "1.70.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
Expand Down
Loading