@@ -146,7 +146,7 @@ impl DrawCtx {
146146 . fonts
147147 . heading
148148 . as_ref ( )
149- . or ( default_config. fonts . heading . as_ref ( ) )
149+ . or_else ( || default_config. fonts . heading . as_ref ( ) )
150150 . unwrap ( )
151151 } ) ;
152152 tag_h1. set_property_size_points ( tag_h1. get_property_size_points ( ) * 1.4 ) ;
@@ -156,7 +156,7 @@ impl DrawCtx {
156156 . fonts
157157 . heading
158158 . as_ref ( )
159- . or ( default_config. fonts . heading . as_ref ( ) )
159+ . or_else ( || default_config. fonts . heading . as_ref ( ) )
160160 . unwrap ( )
161161 } ) ;
162162 tag_h1. set_property_size_points ( tag_h1. get_property_size_points ( ) * 1.2 ) ;
@@ -167,7 +167,7 @@ impl DrawCtx {
167167 . fonts
168168 . heading
169169 . as_ref ( )
170- . or ( default_config. fonts . heading . as_ref ( ) )
170+ . or_else ( || default_config. fonts . heading . as_ref ( ) )
171171 . unwrap ( ) ,
172172 ) ;
173173 let tag_pre = DrawCtx :: create_tag (
@@ -176,7 +176,7 @@ impl DrawCtx {
176176 . fonts
177177 . preformatted
178178 . as_ref ( )
179- . or ( default_config. fonts . preformatted . as_ref ( ) )
179+ . or_else ( || default_config. fonts . preformatted . as_ref ( ) )
180180 . unwrap ( ) ,
181181 ) ;
182182 let tag_p = DrawCtx :: create_tag (
@@ -185,7 +185,7 @@ impl DrawCtx {
185185 . fonts
186186 . paragraph
187187 . as_ref ( )
188- . or ( default_config. fonts . paragraph . as_ref ( ) )
188+ . or_else ( || default_config. fonts . paragraph . as_ref ( ) )
189189 . unwrap ( ) ,
190190 ) ;
191191 let tag_q = DrawCtx :: create_tag (
@@ -194,7 +194,7 @@ impl DrawCtx {
194194 . fonts
195195 . quote
196196 . as_ref ( )
197- . or ( default_config. fonts . quote . as_ref ( ) )
197+ . or_else ( || default_config. fonts . quote . as_ref ( ) )
198198 . unwrap ( ) ,
199199 ) ;
200200 tag_q. set_property_style ( pango:: Style :: Italic ) ;
@@ -205,7 +205,7 @@ impl DrawCtx {
205205 . fonts
206206 . quote
207207 . as_ref ( )
208- . or ( default_config. fonts . paragraph . as_ref ( ) )
208+ . or_else ( || default_config. fonts . paragraph . as_ref ( ) )
209209 . unwrap ( ) ,
210210 ) ;
211211
@@ -235,7 +235,7 @@ impl DrawCtx {
235235 let tag_name = match n {
236236 1 => "h1" ,
237237 2 => "h2" ,
238- 3 | _ => "h3" ,
238+ _ => "h3" ,
239239 } ;
240240
241241 let start = text_iter. get_offset ( ) ;
@@ -291,7 +291,7 @@ impl DrawCtx {
291291 . fonts
292292 . paragraph
293293 . as_ref ( )
294- . or ( default_config. fonts . paragraph . as_ref ( ) )
294+ . or_else ( || default_config. fonts . paragraph . as_ref ( ) )
295295 . unwrap ( ) ;
296296
297297 let tag = gtk:: TextTagBuilder :: new ( )
@@ -305,7 +305,7 @@ impl DrawCtx {
305305
306306 Self :: set_linkhandler ( & tag, link. clone ( ) ) ;
307307
308- let label = label. unwrap_or ( link. url ( ) ) ;
308+ let label = label. unwrap_or_else ( || link. url ( ) ) ;
309309 info ! ( "Setted url {:?} to tag" , Self :: get_linkhandler( & tag) ) ;
310310 debug ! ( "Link set successfully" ) ;
311311 self . insert_paragraph ( & mut text_iter, & label) ;
0 commit comments