@@ -27,12 +27,12 @@ pub struct Opts {
27
27
}
28
28
29
29
impl Profile {
30
- fn base_dir ( config : & Config ) -> Result < PathBuf , HoustonProblem > {
31
- Ok ( config. home . join ( "profiles" ) )
30
+ fn base_dir ( config : & Config ) -> PathBuf {
31
+ config. home . join ( "profiles" )
32
32
}
33
33
34
- fn dir ( name : & str , config : & Config ) -> Result < PathBuf , HoustonProblem > {
35
- Ok ( Profile :: base_dir ( config) ? . join ( name) )
34
+ fn dir ( name : & str , config : & Config ) -> PathBuf {
35
+ Profile :: base_dir ( config) . join ( name)
36
36
}
37
37
38
38
/// Writes an api_key to the filesystem (`$APOLLO_CONFIG_HOME/profiles/<profile_name>/.sensitive`).
@@ -73,7 +73,7 @@ impl Profile {
73
73
/// Loads and deserializes configuration from the file system for a
74
74
/// specific profile.
75
75
pub fn load ( name : & str , config : & Config , opts : LoadOpts ) -> Result < Profile , HoustonProblem > {
76
- if Profile :: dir ( name, config) ? . exists ( ) {
76
+ if Profile :: dir ( name, config) . exists ( ) {
77
77
if opts. sensitive {
78
78
let sensitive = Sensitive :: load ( name, config) ?;
79
79
return Ok ( Profile { sensitive } ) ;
@@ -86,7 +86,7 @@ impl Profile {
86
86
87
87
/// Deletes profile data from file system.
88
88
pub fn delete ( name : & str , config : & Config ) -> Result < ( ) , HoustonProblem > {
89
- let dir = Profile :: dir ( name, config) ? ;
89
+ let dir = Profile :: dir ( name, config) ;
90
90
tracing:: debug!( dir = ?dir) ;
91
91
Ok ( fs:: remove_dir_all ( dir) . map_err ( |e| match e. kind ( ) {
92
92
std:: io:: ErrorKind :: NotFound => HoustonProblem :: ProfileNotFound ( name. to_string ( ) ) ,
@@ -96,7 +96,7 @@ impl Profile {
96
96
97
97
/// Lists profiles based on directories in `$APOLLO_CONFIG_HOME/profiles`
98
98
pub fn list ( config : & Config ) -> Result < Vec < String > , HoustonProblem > {
99
- let profiles_dir = Profile :: base_dir ( config) ? ;
99
+ let profiles_dir = Profile :: base_dir ( config) ;
100
100
let mut profiles = vec ! [ ] ;
101
101
102
102
// if profiles dir doesn't exist return empty vec
0 commit comments