File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed
Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ pub(crate) struct Paste {
2626 /// If the paste still in the database and can be fetched with another request.
2727 is_available : bool ,
2828 html : String ,
29- title : String ,
29+ title : Option < String > ,
3030}
3131
3232#[ expect( clippy:: too_many_arguments) ]
@@ -63,7 +63,7 @@ pub async fn get(
6363 . zip ( data. uid )
6464 . is_some_and ( |( Uid ( user_uid) , owner_uid) | user_uid == owner_uid) ;
6565
66- let title = data. title . clone ( ) . unwrap_or_default ( ) ;
66+ let title = data. title . clone ( ) ;
6767
6868 let html = if let Some ( html) = cache. get ( & key) {
6969 tracing:: trace!( ?key, "found cached item" ) ;
@@ -103,7 +103,7 @@ impl Paste {
103103 theme : Option < Theme > ,
104104 can_delete : bool ,
105105 is_available : bool ,
106- title : String ,
106+ title : Option < String > ,
107107 page : Page ,
108108 ) -> Self {
109109 let html = html. into_inner ( ) ;
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ pub async fn get(
2626 } ;
2727
2828 let key: Key = id. parse ( ) ?;
29- let title = db. get_title ( key. id ) . await ?. unwrap_or_default ( ) ;
29+ let title = db. get_title ( key. id ) . await ?;
3030
3131 // TODO: fix the bogus hardcoded can_delete and is_deleted fields.
3232 Ok ( Qr {
@@ -53,7 +53,7 @@ pub(crate) struct Qr {
5353 can_delete : bool ,
5454 is_available : bool ,
5555 code : qrcodegen:: QrCode ,
56- title : String ,
56+ title : Option < String > ,
5757}
5858
5959impl Qr {
Original file line number Diff line number Diff line change 11{% extends "base.html" %}
22
33{% block title %}
4- {% if !title.is_empty() %}
4+ {% if let Some(title) = title %}
55 < div class ="nav-title "> {{ title }}</ div >
66 {% endif %}
77{% endblock %}
88
9- {% block title_content %}{% if title.len() > 0 %}: {{ title }}{% endif %}{% endblock %}
9+ {% block title_content %}{% if let Some(title) = title %}: {{ title }}{% endif %}{% endblock %}
1010
1111{% block head %}
1212< script defer src ="{{ page.assets.paste_js.route() }} "> </ script >
You can’t perform that action at this time.
0 commit comments