File: 2001_tracing-unwrap.patch

package info (click to toggle)
rust-microformats 0.15.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,092 kB
  • sloc: javascript: 71; makefile: 26; sh: 1
file content (154 lines) | stat: -rw-r--r-- 5,402 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
Description: avoid not-in-Debian crate tracing_unwrap
Author: Jonas Smedegaard <dr@jones.dk>
Forwarded: not-needed
Last-Update: 2025-01-23
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/library/Cargo.toml
+++ b/library/Cargo.toml
@@ -27,7 +27,6 @@
 thiserror.workspace = true
 time.workspace = true
 tracing.workspace = true
-tracing-unwrap = { version = "1.0" }
 url.workspace = true
 
 [dev-dependencies]
--- a/library/src/parse/property/explicit/test.rs
+++ b/library/src/parse/property/explicit/test.rs
@@ -4,7 +4,6 @@
     ElementRef,
 };
 use microformats_types::temporal;
-use tracing_unwrap::OptionExt;
 
 #[test]
 fn linked() -> Result<(), crate::Error> {
@@ -12,7 +11,7 @@
         &from_html_str(r#"<a href='/foo' class='u-url'>a place</a>"#),
         "a",
     )
-    .unwrap_or_log();
+    .unwrap();
 
     let parser = explicit::PropertyParser::new(
         Arc::new(ElementRef {
@@ -45,7 +44,7 @@
     }
 )]
 fn temporal_value(html: &str, tag: &str, value: temporal::Value) -> Result<(), crate::Error> {
-    let elem = grab_element_from_document(&from_html_str(html), tag).unwrap_or_log();
+    let elem = grab_element_from_document(&from_html_str(html), tag).unwrap();
 
     let parser = explicit::PropertyParser::new(
         Arc::new(ElementRef {
@@ -71,7 +70,7 @@
         &from_html_str(r#"<span class="e-content">The name is in <strong>bold</strong>.</span>"#),
         "span",
     )
-    .unwrap_or_log();
+    .unwrap();
 
     let parser = explicit::PropertyParser::new(
         Arc::new(ElementRef {
@@ -107,7 +106,7 @@
     tag_link = { "link", r#"<link class="p-name value" href='/place' title="The name." />"# },
 )]
 fn plain(tag_name: &str, html: &str) -> Result<(), crate::Error> {
-    let elem = grab_element_from_document(&from_html_str(html), tag_name).unwrap_or_log();
+    let elem = grab_element_from_document(&from_html_str(html), tag_name).unwrap();
 
     let parser = PropertyParser::new(
         Arc::new(ElementRef {
@@ -135,7 +134,7 @@
         &from_html_str(r#"<br class="p-honorific-suffix" />BSc<br />"#),
         "br",
     )
-    .unwrap_or_log();
+    .unwrap();
 
     let parser = PropertyParser::new(
         Arc::new(ElementRef {
--- a/library/src/parse/property/implied/test.rs
+++ b/library/src/parse/property/implied/test.rs
@@ -3,7 +3,6 @@
     element::test::{from_html_str, grab_element_from_document},
     ElementRef,
 };
-use tracing_unwrap::OptionExt;
 
 #[yare::parameterized(
     simple = {
@@ -39,7 +38,7 @@
 )]
 fn photo(html: &str, tag: &str, value: Option<PropertyValue>) -> Result<(), crate::Error> {
     let base_url: url::Url = "http://example.com".parse()?;
-    let elem = grab_element_from_document(&from_html_str(html), tag).unwrap_or_log();
+    let elem = grab_element_from_document(&from_html_str(html), tag).unwrap();
 
     let parser = ImpliedPhotoExtractor(Arc::new(ElementRef {
         index: 0,
@@ -106,7 +105,7 @@
     let direct_parser = ImpliedNameExtractor(Arc::new(ElementRef {
         index: 0,
         node: Node {
-            elem: grab_element_from_document(&from_html_str(&full_html), tag).unwrap_or_log(),
+            elem: grab_element_from_document(&from_html_str(&full_html), tag).unwrap(),
         },
     }));
 
@@ -120,7 +119,7 @@
 #[test]
 fn url() -> Result<(), crate::Error> {
     let dom = from_html_str(r#"<div class="h-item"><a class="h-item" href="/"></a></div>"#);
-    let parent_elem = grab_element_from_document(&dom, "div").unwrap_or_log();
+    let parent_elem = grab_element_from_document(&dom, "div").unwrap();
 
     let parent_parser = PropertiesParser::new(
         Arc::new(ElementRef {
@@ -138,7 +137,7 @@
 
     assert_eq!(parent_parser.implied_url(), None, "did not imply a URL");
 
-    let child_elem = grab_element_from_document(&dom, "a").unwrap_or_log();
+    let child_elem = grab_element_from_document(&dom, "a").unwrap();
 
     let child_parser = PropertiesParser::new(
         Arc::new(ElementRef {
--- a/library/src/parse/property/item/test.rs
+++ b/library/src/parse/property/item/test.rs
@@ -4,14 +4,13 @@
     ElementRef, MatchedElements,
 };
 use microformats_types::KnownClass;
-use tracing_unwrap::OptionExt;
 
 #[test]
 fn plain() -> Result<(), crate::parse::Error> {
     let plain_text_dom = from_html_str(
         r#"<div class='h-entry'><a href='/foo' class='p-author h-card'>a <span class='p-tag'>place</span></a></div>"#,
     );
-    let plain_text_elem = grab_element_from_document(&plain_text_dom, "a").unwrap_or_log();
+    let plain_text_elem = grab_element_from_document(&plain_text_dom, "a").unwrap();
 
     let plain_text_parser = PropertyParser::new(
         Arc::new(ElementRef {
@@ -56,7 +55,7 @@
     let linked_dom = from_html_str(
         r#"<div class='h-entry'><a href='/foo' class='u-author h-card'>a <span class='p-name'>place</span></a></div>"#,
     );
-    let linked_elem = grab_element_from_document(&linked_dom, "a").unwrap_or_log();
+    let linked_elem = grab_element_from_document(&linked_dom, "a").unwrap();
 
     let linked_parser = PropertyParser::new(
         Arc::new(ElementRef {
--- a/types/Cargo.toml
+++ b/types/Cargo.toml
@@ -18,7 +18,6 @@
 thiserror = { workspace = true }
 time = { workspace = true }
 tracing = { version = "0.1", optional = true }
-tracing-unwrap = { version = "1.0", optional = true }
 url = { workspace = true }
 
 [dev-dependencies]