You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/dmi/icon.rs
+33-25Lines changed: 33 additions & 25 deletions
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,9 @@ impl Icon {
21
21
let chunk_ztxt = match&raw_dmi.chunk_ztxt{
22
22
Some(chunk) => chunk.clone(),
23
23
None => {
24
-
returnErr(error::DmiError::Generic("Error loading icon: no zTXt chunk found.".to_string()))
24
+
returnErr(error::DmiError::Generic(
25
+
"Error loading icon: no zTXt chunk found.".to_string(),
26
+
))
25
27
}
26
28
};
27
29
let decompressed_text = chunk_ztxt.data.decode()?;
@@ -39,7 +41,9 @@ impl Icon {
39
41
let current_line = match decompressed_text.next(){
40
42
Some(thing) => thing,
41
43
None => {
42
-
returnErr(error::DmiError::Generic("Error loading icon: no version header found.".to_string()))
44
+
returnErr(error::DmiError::Generic(
45
+
"Error loading icon: no version header found.".to_string(),
46
+
))
43
47
}
44
48
};
45
49
let split_version:Vec<&str> = current_line.split_terminator(" = ").collect();
@@ -54,7 +58,9 @@ impl Icon {
54
58
let current_line = match decompressed_text.next(){
55
59
Some(thing) => thing,
56
60
None => {
57
-
returnErr(error::DmiError::Generic("Error loading icon: no width found.".to_string()))
61
+
returnErr(error::DmiError::Generic(
62
+
"Error loading icon: no width found.".to_string(),
63
+
))
58
64
}
59
65
};
60
66
let split_version:Vec<&str> = current_line.split_terminator(" = ").collect();
@@ -69,7 +75,9 @@ impl Icon {
69
75
let current_line = match decompressed_text.next(){
70
76
Some(thing) => thing,
71
77
None => {
72
-
returnErr(error::DmiError::Generic("Error loading icon: no height found.".to_string()))
78
+
returnErr(error::DmiError::Generic(
79
+
"Error loading icon: no height found.".to_string(),
80
+
))
73
81
}
74
82
};
75
83
let split_version:Vec<&str> = current_line.split_terminator(" = ").collect();
@@ -110,7 +118,9 @@ impl Icon {
110
118
letmut current_line = match decompressed_text.next(){
111
119
Some(thing) => thing,
112
120
None => {
113
-
returnErr(error::DmiError::Generic("Error loading icon: no DMI trailer nor states found.".to_string()))
121
+
returnErr(error::DmiError::Generic(
122
+
"Error loading icon: no DMI trailer nor states found.".to_string(),
123
+
))
114
124
}
115
125
};
116
126
@@ -157,7 +167,9 @@ impl Icon {
157
167
current_line = match decompressed_text.next(){
158
168
Some(thing) => thing,
159
169
None => {
160
-
returnErr(error::DmiError::Generic("Error loading icon: no DMI trailer found.".to_string()))
170
+
returnErr(error::DmiError::Generic(
171
+
"Error loading icon: no DMI trailer found.".to_string(),
172
+
))
161
173
}
162
174
};
163
175
@@ -291,26 +303,22 @@ impl Icon {
291
303
},
292
304
None => returnErr(error::DmiError::Generic(format!("Error saving Icon: number of frames ({}) larger than one without a delay entry in icon state of name \"{}\".", icon_state.frames, icon_state.name)))
0 commit comments