Skip to content

Commit

Permalink
refactor: Using IsZero for absto
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Boutour <[email protected]>
  • Loading branch information
ViBiOh committed Sep 10, 2022
1 parent 59208e7 commit dd2817a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/crud/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func newCover(item provider.RenderItem, size uint64) cover {
}

func (c cover) IsZero() bool {
return len(c.Img.Item.Name) == 0
return c.Img.IsZero()
}

func (a App) getCover(ctx context.Context, request provider.Request, files []absto.Item) (output cover) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/provider/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ type RenderItem struct {
}

func (r RenderItem) IsZero() bool {
return len(r.Item.Pathname) == 0
return r.Item.IsZero()
}

func (r RenderItem) IsImage() bool {
Expand Down
2 changes: 1 addition & 1 deletion pkg/provider/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func (w Webhook) hasType(eventType EventType) bool {
}

func (w Webhook) matchItem(item absto.Item) bool {
if len(item.Name) == 0 {
if item.IsZero() {
return false
}

Expand Down

0 comments on commit dd2817a

Please sign in to comment.