6 个版本

0.1.13 2024年7月16日
0.1.12 2024年6月24日
0.1.2 2024年2月22日
0.1.1 2023年11月28日

#2102 in 解析器实现

Download history 132/week @ 2024-04-25 260/week @ 2024-05-02 227/week @ 2024-05-09 175/week @ 2024-05-16 142/week @ 2024-05-23 206/week @ 2024-05-30 607/week @ 2024-06-06 758/week @ 2024-06-13 637/week @ 2024-06-20 609/week @ 2024-06-27 407/week @ 2024-07-04 567/week @ 2024-07-11 243/week @ 2024-07-18 791/week @ 2024-07-25 1031/week @ 2024-08-01 1219/week @ 2024-08-08

3,329 每月下载量
3 个crate中使用(通过 debian-analyzer

Apache-2.0

63KB
1.5K SLoC

Debian DEP-3 补丁头部的 Rust 解析器

示例

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()]);

有关详细信息,请参阅 https://dep-team.pages.debian.net/deps/dep3/


lib.rs:

用于解析和生成 Debian 补丁头的库。

示例

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()]);

依赖项

~4–6MB
~105K SLoC