Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
limalogger
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
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
Stephen D
limalogger
Commits
504456cb
Commit
504456cb
authored
2 years ago
by
Stephen D
Browse files
Options
Downloads
Patches
Plain Diff
fix clippy lints
parent
e9089533
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#2623
passed
1 year ago
Stage: test
Stage: build
Changes
3
Pipelines
187
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/adif.rs
+2
-2
2 additions, 2 deletions
src/adif.rs
src/app.rs
+5
-8
5 additions, 8 deletions
src/app.rs
src/traits.rs
+1
-1
1 addition, 1 deletion
src/traits.rs
with
8 additions
and
11 deletions
src/adif.rs
+
2
−
2
View file @
504456cb
...
...
@@ -9,8 +9,8 @@ pub trait AdifEncoder {
fn
encode
(
station
:
&
Station
,
qsos
:
Vec
<
Qso
>
)
->
AdifFile
;
fn
save
(
station
:
&
Station
,
qsos
:
Vec
<
Qso
>
,
filename
:
&
str
)
->
Result
<
(),
String
>
{
let
adif
=
Self
::
encode
(
station
,
qsos
);
let
contents
=
adif
.serialize
()
.map_err
(|
x
|
format!
(
"{}"
,
x
))
?
;
fs
::
write
(
filename
,
contents
)
.map_err
(|
x
|
format!
(
"{}"
,
x
))
?
;
let
contents
=
adif
.serialize
()
.map_err
(|
x
|
format!
(
"{
x
}"
))
?
;
fs
::
write
(
filename
,
contents
)
.map_err
(|
x
|
format!
(
"{
x
}"
))
?
;
Ok
(())
}
...
...
This diff is collapsed.
Click to expand it.
src/app.rs
+
5
−
8
View file @
504456cb
...
...
@@ -50,7 +50,7 @@ impl App {
// Create new file
let
state
=
State
::
default
();
if
let
Err
(
e
)
=
state
.save_file
(
&
filename
)
{
eprintln!
(
"Could not create file {
}: {}"
,
filename
,
e
);
eprintln!
(
"Could not create file {filename
}: {e}"
);
return
None
;
}
state
...
...
@@ -92,7 +92,7 @@ impl App {
self
.state
.sort
();
if
let
Err
(
e
)
=
self
.state
.save_file
(
&
self
.filename
)
{
eprintln!
(
"Couldn't save file: {}"
,
e
);
eprintln!
(
"Couldn't save file: {
e
}"
);
}
}
}
...
...
@@ -189,10 +189,7 @@ impl App {
let
buffer
=
buffer
.trim
();
if
!
buffer
.is_empty
()
{
if
let
Err
(
e
)
=
QrzEncoder
::
save
(
&
self
.state.station
,
self
.state.qsos
.clone
(),
buffer
)
{
println!
(
"Could not export ADIF file: {}
\n
Press any key to continue..."
,
e
);
println!
(
"Could not export ADIF file: {e}
\n
Press any key to continue..."
,);
getch
::
Getch
::
new
()
.getch
()
.unwrap
();
}
}
...
...
@@ -262,9 +259,9 @@ impl App {
let
default_s
=
default_s
.trim
();
if
default_s
.trim
()
.is_empty
()
{
print!
(
"{
}? "
,
label
);
print!
(
"{label
}? "
);
}
else
{
print!
(
"{
} [{}]? "
,
label
,
default_s
);
print!
(
"{label
} [{
default_s
}]? "
);
}
Self
::
flush
();
...
...
This diff is collapsed.
Click to expand it.
src/traits.rs
+
1
−
1
View file @
504456cb
...
...
@@ -28,7 +28,7 @@ impl TuiValue for String {
impl
TuiValue
for
f64
{
fn
to_string
(
&
self
)
->
String
{
format!
(
"{
}"
,
self
)
format!
(
"{self
}"
)
}
fn
from_str
(
s
:
&
str
)
->
Option
<
Self
>
{
...
...
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