diff --git a/src/lockfile.rs b/src/lockfile.rs index be13950abc..a6f1fc12ab 100644 --- a/src/lockfile.rs +++ b/src/lockfile.rs @@ -25,7 +25,7 @@ pub struct LockfileTool { } impl Lockfile { - pub fn read>(path: P) -> Result { + fn read>(path: P) -> Result { trace!("reading lockfile {}", display_path(&path)); let content = file::read_to_string(path)?; let mut table: toml::Table = toml::from_str(&content)?; @@ -47,8 +47,7 @@ impl Lockfile { Ok(lockfile) } - pub fn save>(&self, path: P) -> Result<()> { - SETTINGS.ensure_experimental("lockfile")?; + fn save>(&self, path: P) -> Result<()> { if self.is_empty() { let _ = file::remove_file(path); } else { @@ -74,7 +73,7 @@ impl Lockfile { Ok(()) } - pub fn is_empty(&self) -> bool { + fn is_empty(&self) -> bool { self.tools.is_empty() } } @@ -83,7 +82,6 @@ pub fn update_lockfiles(new_versions: &[ToolVersion]) -> Result<()> { if !SETTINGS.lockfile || !SETTINGS.experimental { return Ok(()); } - SETTINGS.ensure_experimental("lockfile")?; let config = Config::load()?; let ts = ToolsetBuilder::new().build(&config)?; let mut all_tool_names = HashSet::new(); @@ -185,10 +183,9 @@ pub fn get_locked_version( short: &str, prefix: &str, ) -> Result> { - if !SETTINGS.lockfile { + if !SETTINGS.lockfile || !SETTINGS.experimental { return Ok(None); } - SETTINGS.ensure_experimental("lockfile")?; let lockfile = match path { Some(path) => {