Skip to main content

read_optional_lockfile

Function read_optional_lockfile 

Source
pub fn read_optional_lockfile(path: &Path) -> Result<Option<Lockfile>>
Expand description

Read a lockfile that may legitimately not exist.

Ok(None) means “no lockfile here”, which is normal for the global scope on a machine that has never used --global. Anything else, in particular a corrupt or too-new file, is an error: reporting it as “nothing installed” would be a confident wrong answer.