Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
collective
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eduardo Trujillo
collective
Commits
34c0ca96
Verified
Commit
34c0ca96
authored
3 years ago
by
Eduardo Trujillo
Browse files
Options
Downloads
Patches
Plain Diff
style(config): Run cargo fmt
parent
269162bc
No related branches found
No related tags found
No related merge requests found
Pipeline
#228
passed
3 years ago
Stage: format
Stage: build
Stage: lint
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/config.rs
+10
-5
10 additions, 5 deletions
src/config.rs
with
10 additions
and
5 deletions
src/config.rs
+
10
−
5
View file @
34c0ca96
...
...
@@ -135,7 +135,10 @@ pub fn from_default_paths<P: AsRef<Path>, C: DeserializeOwned>(
let
mut
paths
=
as_paths
(
additional_paths
);
paths
.push
((
get_current_dir_config_path
(
&
format
)
?
,
Some
(
format
.clone
())));
paths
.push
((
get_name_config_path
(
application_name
,
&
format
),
Some
(
format
)));
paths
.push
((
get_name_config_path
(
application_name
,
&
format
),
Some
(
format
),
));
from_paths
(
paths
)
}
...
...
@@ -152,7 +155,10 @@ pub fn from_defaults<P: AsRef<Path>, C: DeserializeOwned + Default + Serialize>(
let
mut
paths
=
as_paths
(
additional_paths
);
paths
.push
((
get_current_dir_config_path
(
&
format
)
?
,
Some
(
format
.clone
())));
paths
.push
((
get_name_config_path
(
application_name
,
&
format
),
Some
(
format
)));
paths
.push
((
get_name_config_path
(
application_name
,
&
format
),
Some
(
format
),
));
let
default_config
:
C
=
Default
::
default
();
let
figment
=
Figment
::
from
(
Serialized
::
from
(
default_config
,
Profile
::
default
()));
...
...
@@ -166,8 +172,7 @@ pub fn from_defaults<P: AsRef<Path>, C: DeserializeOwned + Default + Serialize>(
debug!
(
"Using env prefix: {}"
,
&
env_prefix
);
extract
(
figment
.merge
(
Env
::
prefixed
(
&
env_prefix
)))
extract
(
figment
.merge
(
Env
::
prefixed
(
&
env_prefix
)))
}
fn
as_paths
<
P
:
AsRef
<
Path
>>
(
...
...
@@ -231,4 +236,4 @@ fn extract<C: DeserializeOwned>(figment: Figment) -> Result<C, ConfigError> {
figment
.extract
()
.map_err
(|
source
|
ConfigError
::
ExtractConfig
{
source
})
}
\ No newline at end of file
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment