@@ -3,9 +3,6 @@ use std::{
33 ops:: { Deref , Range } ,
44} ;
55
6- use bstr:: { BStr , BString , ByteSlice , ByteVec } ;
7- use smallvec:: SmallVec ;
8-
96use crate :: {
107 file:: {
118 self ,
@@ -16,6 +13,9 @@ use crate::{
1613 parse:: { section:: ValueName , Event } ,
1714 value:: { normalize, normalize_bstr, normalize_bstring} ,
1815} ;
16+ use bstr:: { BStr , BString , ByteSlice , ByteVec } ;
17+ use gix_sec:: Trust ;
18+ use smallvec:: SmallVec ;
1919
2020/// A opaque type that represents a mutable reference to a section.
2121#[ derive( PartialEq , Eq , Hash , PartialOrd , Ord , Debug ) ]
@@ -142,6 +142,14 @@ impl<'event> SectionMut<'_, 'event> {
142142 }
143143 }
144144
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+
145153 /// Removes the latest value by key and returns it, if it exists.
146154 pub fn remove ( & mut self , value_name : & str ) -> Option < Cow < ' event , BStr > > {
147155 let key = ValueName :: from_str_unchecked ( value_name) ;
0 commit comments