@@ -166,6 +166,9 @@ pub enum Level {
166
166
}
167
167
168
168
impl Level {
169
+ /// Text passed to this function is considered "untrusted input", as such
170
+ /// all text is passed through a normalization function. Pre-styled text is
171
+ /// not allowed to be passed to this function.
169
172
pub fn message ( self , title : & str ) -> Message < ' _ > {
170
173
Message {
171
174
id : None ,
@@ -222,6 +225,9 @@ pub struct Snippet<'a, T> {
222
225
}
223
226
224
227
impl < ' a , T : Clone > Snippet < ' a , T > {
228
+ /// Text passed to this function is considered "untrusted input", as such
229
+ /// all text is passed through a normalization function. Pre-styled text is
230
+ /// not allowed to be passed to this function.
225
231
pub fn source ( source : & ' a str ) -> Self {
226
232
Self {
227
233
origin : None ,
@@ -237,6 +243,9 @@ impl<'a, T: Clone> Snippet<'a, T> {
237
243
self
238
244
}
239
245
246
+ /// Text passed to this function is considered "untrusted input", as such
247
+ /// all text is passed through a normalization function. Pre-styled text is
248
+ /// not allowed to be passed to this function.
240
249
pub fn origin ( mut self , origin : & ' a str ) -> Self {
241
250
self . origin = Some ( origin) ;
242
251
self
@@ -281,6 +290,9 @@ pub struct Annotation<'a> {
281
290
}
282
291
283
292
impl < ' a > Annotation < ' a > {
293
+ /// Text passed to this function is considered "untrusted input", as such
294
+ /// all text is passed through a normalization function. Pre-styled text is
295
+ /// not allowed to be passed to this function.
284
296
pub fn label ( mut self , label : & ' a str ) -> Self {
285
297
self . label = Some ( label) ;
286
298
self
@@ -322,6 +334,9 @@ pub struct Patch<'a> {
322
334
}
323
335
324
336
impl < ' a > Patch < ' a > {
337
+ /// Text passed to this function is considered "untrusted input", as such
338
+ /// all text is passed through a normalization function. Pre-styled text is
339
+ /// not allowed to be passed to this function.
325
340
pub fn new ( range : Range < usize > , replacement : & ' a str ) -> Self {
326
341
Self { range, replacement }
327
342
}
@@ -384,6 +399,9 @@ pub struct Origin<'a> {
384
399
}
385
400
386
401
impl < ' a > Origin < ' a > {
402
+ /// Text passed to this function is considered "untrusted input", as such
403
+ /// all text is passed through a normalization function. Pre-styled text is
404
+ /// not allowed to be passed to this function.
387
405
pub fn new ( origin : & ' a str ) -> Self {
388
406
Self {
389
407
origin,
@@ -409,6 +427,9 @@ impl<'a> Origin<'a> {
409
427
self
410
428
}
411
429
430
+ /// Text passed to this function is considered "untrusted input", as such
431
+ /// all text is passed through a normalization function. Pre-styled text is
432
+ /// not allowed to be passed to this function.
412
433
pub fn label ( mut self , label : & ' a str ) -> Self {
413
434
self . label = Some ( label) ;
414
435
self
0 commit comments