File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -237,15 +237,21 @@ impl Config {
237
237
/// This is the same as `get_bytes` except that it may return `Err` if
238
238
/// the bytes are not valid utf-8.
239
239
///
240
- /// This method will return an error if this `Config` is not a snapshot.
240
+ /// For consistency reasons, this method can only be called on a [`snapshot`].
241
+ /// An error will be returned otherwise.
242
+ ///
243
+ /// [`snapshot`]: `crate::Config::snapshot`
241
244
pub fn get_str ( & self , name : & str ) -> Result < & str , Error > {
242
245
str:: from_utf8 ( self . get_bytes ( name) ?)
243
246
. map_err ( |_| Error :: from_str ( "configuration value is not valid utf8" ) )
244
247
}
245
248
246
249
/// Get the value of a string config variable as a byte slice.
247
250
///
248
- /// This method will return an error if this `Config` is not a snapshot.
251
+ /// For consistency reasons, this method can only be called on a [`snapshot`].
252
+ /// An error will be returned otherwise.
253
+ ///
254
+ /// [`snapshot`]: `crate::Config::snapshot`
249
255
pub fn get_bytes ( & self , name : & str ) -> Result < & [ u8 ] , Error > {
250
256
let mut ret = ptr:: null ( ) ;
251
257
let name = CString :: new ( name) ?;
You can’t perform that action at this time.
0 commit comments