@@ -3,9 +3,6 @@ use std::{
3
3
ops:: { Deref , Range } ,
4
4
} ;
5
5
6
- use bstr:: { BStr , BString , ByteSlice , ByteVec } ;
7
- use smallvec:: SmallVec ;
8
-
9
6
use crate :: {
10
7
file:: {
11
8
self ,
@@ -16,6 +13,9 @@ use crate::{
16
13
parse:: { section:: ValueName , Event } ,
17
14
value:: { normalize, normalize_bstr, normalize_bstring} ,
18
15
} ;
16
+ use bstr:: { BStr , BString , ByteSlice , ByteVec } ;
17
+ use gix_sec:: Trust ;
18
+ use smallvec:: SmallVec ;
19
19
20
20
/// A opaque type that represents a mutable reference to a section.
21
21
#[ derive( PartialEq , Eq , Hash , PartialOrd , Ord , Debug ) ]
@@ -142,6 +142,14 @@ impl<'event> SectionMut<'_, 'event> {
142
142
}
143
143
}
144
144
145
+ /// Set the trust level in the meta-data of this section to `trust`.
146
+ pub fn set_trust ( & mut self , trust : Trust ) -> & mut Self {
147
+ let mut meta = ( * self . section . meta ) . clone ( ) ;
148
+ meta. trust = trust;
149
+ self . section . meta = meta. into ( ) ;
150
+ self
151
+ }
152
+
145
153
/// Removes the latest value by key and returns it, if it exists.
146
154
pub fn remove ( & mut self , value_name : & str ) -> Option < Cow < ' event , BStr > > {
147
155
let key = ValueName :: from_str_unchecked ( value_name) ;
0 commit comments