bug 1494613: mozprofile: add docs for Pref::new and ::new_sticky r=whimboo
authorAndreas Tolfsen <ato@sny.no>
Thu, 27 Sep 2018 13:17:56 +0000
changeset 494626 baff8a950809384341075f414bbeddff204b731a
parent 494625 52f567d78430b2b245930e9f20375e790d77b07e
child 494627 0fcb85b4c2f2580df3de46af1c10b260dd156a44
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswhimboo
bugs1494613
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 1494613: mozprofile: add docs for Pref::new and ::new_sticky r=whimboo
testing/mozbase/rust/mozprofile/src/preferences.rs
--- a/testing/mozbase/rust/mozprofile/src/preferences.rs
+++ b/testing/mozbase/rust/mozprofile/src/preferences.rs
@@ -74,26 +74,29 @@ impl From<i64> for PrefValue {
 
 #[derive(Debug, PartialEq, Clone)]
 pub struct Pref {
     pub value: PrefValue,
     pub sticky: bool,
 }
 
 impl Pref {
+    /// Create a new preference with `value`.
     pub fn new<T>(value: T) -> Pref
     where
         T: Into<PrefValue>,
     {
         Pref {
             value: value.into(),
             sticky: false,
         }
     }
 
+    /// Create a new sticky, or locked, preference with `value`.
+    /// These cannot be changed by the user in `about:config`.
     pub fn new_sticky<T>(value: T) -> Pref
     where
         T: Into<PrefValue>,
     {
         Pref {
             value: value.into(),
             sticky: true,
         }