Skip to content

Commit 82776a3

Browse files
committed
Fix unhandled error in access function calls
1 parent 58140de commit 82776a3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/main.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ pub fn run_command(ctx: &Context, command: Command) -> Result<()> {
5959
///
6060
/// Initialize a new config file.
6161
fn init(ctx: &Context, shell: Option<Shell>) -> Result<()> {
62-
let _guard = access(ctx, Access::W);
62+
let _guard = access(ctx, Access::W)?;
6363
let path = ctx.config_file();
6464
match path
6565
.metadata()
@@ -80,7 +80,7 @@ fn init(ctx: &Context, shell: Option<Shell>) -> Result<()> {
8080
///
8181
/// Add a new plugin to the config file.
8282
fn add(ctx: &Context, name: String, plugin: &EditPlugin) -> Result<()> {
83-
let _guard = access(ctx, Access::W);
83+
let _guard = access(ctx, Access::W)?;
8484
let path = ctx.config_file();
8585
let mut config = match EditConfig::from_path(path) {
8686
Ok(config) => {
@@ -100,7 +100,7 @@ fn add(ctx: &Context, name: String, plugin: &EditPlugin) -> Result<()> {
100100
///
101101
/// Open up the config file in the default editor.
102102
fn edit(ctx: &Context) -> Result<()> {
103-
let _guard = access(ctx, Access::W);
103+
let _guard = access(ctx, Access::W)?;
104104
let path = ctx.config_file();
105105
let original_contents = match fs::read_to_string(path)
106106
.with_context(|| format!("failed to read from `{}`", path.display()))
@@ -129,7 +129,7 @@ fn edit(ctx: &Context) -> Result<()> {
129129
///
130130
/// Remove a plugin from the config file.
131131
fn remove(ctx: &Context, name: String) -> Result<()> {
132-
let _guard = access(ctx, Access::W);
132+
let _guard = access(ctx, Access::W)?;
133133
let path = ctx.config_file();
134134
let mut config = EditConfig::from_path(path)?;
135135
ctx.log_header("Loaded", path);
@@ -169,7 +169,7 @@ fn init_config(ctx: &Context, shell: Option<Shell>, path: &Path, err: Error) ->
169169
///
170170
/// Install the plugins sources and generate the lock file.
171171
fn lock(ctx: &Context, warnings: &mut Vec<Error>) -> Result<()> {
172-
let _guard = access(ctx, Access::W);
172+
let _guard = access(ctx, Access::W)?;
173173

174174
let mut locked = locked(ctx, warnings)?;
175175

0 commit comments

Comments
 (0)