mirror of
https://github.com/celogeek/go-comic-converter.git
synced 2025-05-24 07:42:37 +02:00
remove pointer from profiles
This commit is contained in:
parent
e10eeadc4e
commit
b1e246240c
@ -330,7 +330,10 @@ func (o *Options) SaveConfig() error {
|
||||
|
||||
// GetProfile shortcut to get current profile
|
||||
func (o *Options) GetProfile() *profiles.Profile {
|
||||
return o.profiles[o.Profile]
|
||||
if p, ok := o.profiles[o.Profile]; ok {
|
||||
return &p
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// AvailableProfiles all available profiles
|
||||
|
@ -13,7 +13,7 @@ type Profile struct {
|
||||
Height int `json:"height"`
|
||||
}
|
||||
|
||||
type Profiles map[string]*Profile
|
||||
type Profiles map[string]Profile
|
||||
|
||||
// New Initialize list of all supported profiles.
|
||||
func New() Profiles {
|
||||
@ -52,7 +52,7 @@ func New() Profiles {
|
||||
{"RM1", "reMarkable 1", 1404, 1872},
|
||||
{"RM2", "reMarkable 2", 1404, 1872},
|
||||
} {
|
||||
res[r.Code] = &r
|
||||
res[r.Code] = r
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user