6 releases

0.1.13 Jul 16, 2024
0.1.12 Jun 24, 2024
0.1.2 Feb 22, 2024
0.1.1 Nov 28, 2023

#1971 in Parser implementations

Download history 559/week @ 2024-04-03 98/week @ 2024-04-10 348/week @ 2024-04-17 134/week @ 2024-04-24 259/week @ 2024-05-01 224/week @ 2024-05-08 176/week @ 2024-05-15 127/week @ 2024-05-22 221/week @ 2024-05-29 573/week @ 2024-06-05 791/week @ 2024-06-12 612/week @ 2024-06-19 628/week @ 2024-06-26 410/week @ 2024-07-03 540/week @ 2024-07-10 253/week @ 2024-07-17

1,938 downloads per month
Used in 3 crates (via debian-analyzer)

Apache-2.0

62KB
1.5K SLoC

Rust parser for Debian DEP-3 patch headers

Examples

use dep3::PatchHeader;
use std::str::FromStr;
let text = r#"From: John Doe <john.doe@example>
Date: Mon, 1 Jan 2000 00:00:00 +0000
Subject: [PATCH] fix a bug
Bug-Debian: https://bugs.debian.org/123456
Bug: https://bugzilla.example.com/bug.cgi?id=123456
Forwarded: not-needed
"#;

let patch_header = PatchHeader::from_str(text).unwrap();
assert_eq!(patch_header.description(), Some("[PATCH] fix a bug".to_string()));
assert_eq!(patch_header.vendor_bugs("Debian").collect::<Vec<_>>(), vec!["https://bugs.debian.org/123456".to_string()]);

See https://dep-team.pages.debian.net/deps/dep3/ for details


lib.rs:

A library for parsing and generating Debian patch headers.

Examples

use dep3::PatchHeader;
use std::str::FromStr;
let text = r#"From: John Doe <john.doe@example>
Date: Mon, 1 Jan 2000 00:00:00 +0000
Subject: [PATCH] fix a bug
Bug-Debian: https://bugs.debian.org/123456
Bug: https://bugzilla.example.com/bug.cgi?id=123456
Forwarded: not-needed
"#;

let patch_header = PatchHeader::from_str(text).unwrap();
assert_eq!(patch_header.description(), Some("[PATCH] fix a bug".to_string()));
assert_eq!(patch_header.vendor_bugs("Debian").collect::<Vec<_>>(), vec!["https://bugs.debian.org/123456".to_string()]);

Dependencies

~4–6MB
~107K SLoC