mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
Fixed tautological error conditions
Drop error & nil checks where the value can not have changed.
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
c0eef3b401
commit
e88d798990
@@ -70,10 +70,7 @@ func smartCrop(img image.Image, width, height int, anchor imaging.Anchor, filter
|
||||
|
||||
b := img.Bounds().Intersect(rect)
|
||||
|
||||
cropped, err := imaging.Crop(img, b), nil
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
cropped := imaging.Crop(img, b)
|
||||
|
||||
return imaging.Resize(cropped, width, height, filter), nil
|
||||
|
||||
|
Reference in New Issue
Block a user