File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change
1
+ use std:: fmt:: Write ;
1
2
use std:: sync:: Arc ;
2
3
3
4
use anyhow:: Context as _;
@@ -39,15 +40,16 @@ pub async fn notifications(
39
40
out. push_str ( "</head>" ) ;
40
41
out. push_str ( "<body>" ) ;
41
42
42
- out . push_str ( & format ! ( "<h3>Pending notifications for {}</h3>" , user ) ) ;
43
+ _ = write ! ( out , "<h3>Pending notifications for {user }</h3>" ) ;
43
44
44
45
if notifications. is_empty ( ) {
45
46
out. push_str ( "<p><em>You have no pending notifications! :)</em></p>" ) ;
46
47
} else {
47
48
out. push_str ( "<ol>" ) ;
48
49
for notification in notifications {
49
50
out. push_str ( "<li>" ) ;
50
- out. push_str ( & format ! (
51
+ _ = write ! (
52
+ out,
51
53
"<a href='{}'>{}</a>" ,
52
54
notification. origin_url,
53
55
notification
@@ -59,17 +61,18 @@ pub async fn notifications(
59
61
. replace( '>' , ">" )
60
62
. replace( '"' , """ )
61
63
. replace( '\'' , "'" ) ,
62
- ) ) ;
64
+ ) ;
63
65
if let Some ( metadata) = & notification. metadata {
64
- out. push_str ( & format ! (
66
+ _ = write ! (
67
+ out,
65
68
"<ul><li>{}</li></ul>" ,
66
69
metadata
67
70
. replace( '&' , "&" )
68
71
. replace( '<' , "<" )
69
72
. replace( '>' , ">" )
70
73
. replace( '"' , """ )
71
74
. replace( '\'' , "'" ) ,
72
- ) ) ;
75
+ ) ;
73
76
}
74
77
out. push_str ( "</li>" ) ;
75
78
}
You can’t perform that action at this time.
0 commit comments