Skip to content

Commit 19d558c

Browse files
Factor out PathUpdateMethod type
As a private type, PathUpdateMethod cannot be referenced from other files without leaking. This refactors it into a public type kept private to the module.
1 parent 69453d5 commit 19d558c

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/cli/self_update.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ use std::env::consts::EXE_SUFFIX;
4747
use std::fs;
4848
use std::path::{Component, Path, PathBuf};
4949
use std::process::{self, Command};
50+
mod types;
51+
use types::PathUpdateMethod;
5052

5153
pub struct InstallOpts<'a> {
5254
pub default_host_triple: Option<String>,
@@ -1118,12 +1120,6 @@ pub fn complete_windows_uninstall() -> Result<()> {
11181120
panic!("stop doing that")
11191121
}
11201122

1121-
#[derive(PartialEq)]
1122-
enum PathUpdateMethod {
1123-
RcFile(PathBuf),
1124-
Windows,
1125-
}
1126-
11271123
/// Decide which rcfiles we're going to update, so we
11281124
/// can tell the user before they confirm.
11291125
fn get_add_path_methods() -> Vec<PathUpdateMethod> {

src/cli/self_update/types.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#![allow(dead_code)]
2+
use std::path::PathBuf;
3+
4+
#[derive(PartialEq)]
5+
pub enum PathUpdateMethod {
6+
RcFile(PathBuf),
7+
Windows,
8+
}

0 commit comments

Comments
 (0)