Skip to content

Commit d7ad8f0

Browse files
authored
Upgrade logos (#13)
* Update logos to 0.14. * Bump minor version. * Format and clippy fixes. * Update workflow.
1 parent ab3442a commit d7ad8f0

File tree

9 files changed

+104
-94
lines changed

9 files changed

+104
-94
lines changed

Diff for: .github/workflows/audit.yaml

+10-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,15 @@ jobs:
88
security_audit:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v1
12-
- uses: actions-rs/audit-check@v1
11+
- uses: actions/checkout@v4
12+
- name: ⚡ Cache
13+
uses: actions/cache@v4
14+
with:
15+
path: |
16+
~/.cargo/registry
17+
~/.cargo/git
18+
target
19+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
20+
- uses: rustsec/[email protected]
1321
with:
1422
token: ${{ secrets.GITHUB_TOKEN }}

Diff for: .github/workflows/library.yaml

+6-10
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,15 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/checkout@v2
14-
- name: Install Rust
15-
uses: actions-rs/toolchain@v1
16-
with:
17-
components: clippy
18-
- name: Install cargo make
19-
run: cargo install cargo-make
14+
- name: Check
15+
run: cargo check
2016
- name: Install webassembly target
2117
run: rustup target add wasm32-unknown-unknown
2218
- name: Check webassembly
23-
run: cargo make check-wasm
19+
run: cargo check --target wasm32-unknown-unknown
2420
- name: Check cargo fmt
25-
run: cargo make format-check
21+
run: cargo fmt --all -- --check
2622
- name: Check cargo clippy
27-
run: cargo make clippy
23+
run: cargo clippy
2824
- name: Run tests
29-
run: cargo make test
25+
run: cargo test

Diff for: Cargo.toml

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "vcard4"
3-
version = "0.4.4"
3+
version = "0.5.0"
44
edition = "2021"
55
description = "Fast and correct vCard parser for RFC6350"
66
repository = "https://github.com/tmpfs/vcard4"
@@ -9,7 +9,7 @@ license = "MIT OR Apache-2.0"
99

1010
[dependencies]
1111
thiserror = "1"
12-
logos = "0.12"
12+
logos = { version = "0.14", features = ["export_derive"] }
1313
uriparse = "0.6.4"
1414
time = { version = "0.3.19", features = ["parsing", "formatting"] }
1515
unicode-segmentation="1"
@@ -22,7 +22,12 @@ base64 = "0.21.0"
2222

2323
[features]
2424
default = ["zeroize"]
25-
serde = ["dep:serde", "time/serde-human-readable", "language-tags?/serde", "uriparse/serde"]
25+
serde = [
26+
"dep:serde",
27+
"time/serde-human-readable",
28+
"language-tags?/serde",
29+
"uriparse/serde",
30+
]
2631
zeroize = ["dep:zeroize"]
2732
mime = ["dep:mime"]
2833
language-tags = ["dep:language-tags"]

Diff for: rust-toolchain

-1
This file was deleted.

Diff for: rust-toolchain.toml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[toolchain]
2+
channel = "stable"

Diff for: src/error.rs

+14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
use thiserror::Error;
22

3+
/// Error lexing a vcard string.
4+
#[derive(Debug, Error, PartialEq, Clone, Default)]
5+
#[doc(hidden)]
6+
pub enum LexError {
7+
/// Generic lex error.
8+
#[default]
9+
#[error("vcard lex error")]
10+
Other,
11+
}
12+
313
/// Errors generated by the vCard library.
414
#[derive(Debug, Error)]
515
pub enum Error {
@@ -170,4 +180,8 @@ pub enum Error {
170180
/// Error generated decoding from base64.
171181
#[error(transparent)]
172182
Base64(#[from] base64::DecodeError),
183+
184+
/// Error generated during lexing.
185+
#[error(transparent)]
186+
LexError(#[from] LexError),
173187
}

Diff for: src/iter.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ impl<'s> VcardIterator<'s> {
2525
let mut lex = self.parser.lexer();
2626
lex.bump(offset);
2727
while let Some(first) = lex.next() {
28-
if first == Token::NewLine {
28+
if first == Ok(Token::NewLine) {
2929
continue;
3030
} else {
3131
return self.parser.parse_one(&mut lex, Some(first));

0 commit comments

Comments
 (0)