Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Dunitrust
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
nodes
rust
Dunitrust
Commits
ab263374
Commit
ab263374
authored
6 years ago
by
Jonas SPRENGER
Browse files
Options
Downloads
Patches
Plain Diff
[ref] conf: add comment "cannot use macro fatal_error!"
parent
84535270
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!141
Jonas/127 replace all panics by fatal error
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/core/conf/src/lib.rs
+4
-0
4 additions, 0 deletions
lib/core/conf/src/lib.rs
with
4 additions
and
0 deletions
lib/core/conf/src/lib.rs
+
4
−
0
View file @
ab263374
...
...
@@ -417,6 +417,7 @@ impl DuniterKeyPairs {
}
}
// Warning: This function cannot use the macro fatal_error! because the logger is not yet initialized, so it must use panic !
fn
generate_random_keypair
(
algo
:
KeysAlgo
)
->
KeyPairEnum
{
let
mut
rng
=
rand
::
thread_rng
();
match
algo
{
...
...
@@ -462,6 +463,7 @@ pub fn get_conf_path(profile_path: &PathBuf) -> PathBuf {
}
/// Returns the path to the folder containing the user data of the running profile
// Warning: This function cannot use the macro fatal_error! because the logger is not yet initialized, so it must use panic !
pub
fn
get_profile_path
(
profiles_path
:
&
Option
<
PathBuf
>
,
profile_name
:
&
str
)
->
PathBuf
{
// Define and create datas directory if not exist
let
profiles_path
:
PathBuf
=
if
let
Some
(
profiles_path
)
=
profiles_path
{
...
...
@@ -520,6 +522,7 @@ pub fn load_conf(
}
/// Load configuration. at specified path
// Warning: This function cannot use the macro fatal_error! because the logger is not yet initialized, so it must use panic !
pub
fn
load_conf_at_path
(
profile_path
:
PathBuf
,
keypairs_file_path
:
&
Option
<
PathBuf
>
,
...
...
@@ -649,6 +652,7 @@ pub fn load_conf_at_path(
}
/// Save keypairs in profile folder
// Warning: This function cannot use the macro fatal_error! because the logger is not yet initialized, so it must use panic !
pub
fn
write_keypairs_file
(
file_path
:
&
PathBuf
,
keypairs
:
&
DuniterKeyPairs
,
...
...
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