3 releases

0.1.2 Feb 22, 2024
0.1.1 Nov 28, 2023
0.1.0 Nov 28, 2023

#1828 in Parser implementations

Download history 3/week @ 2024-02-13 180/week @ 2024-02-20 22/week @ 2024-02-27 7/week @ 2024-03-05 8/week @ 2024-03-12 76/week @ 2024-03-19 322/week @ 2024-03-26 578/week @ 2024-04-02 95/week @ 2024-04-09 342/week @ 2024-04-16

1,397 downloads per month

Apache-2.0

53KB
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
~108K SLoC