Skip to content

Commit 049f1dd

Browse files
committed
refactor: remove uneeded code and use struct literal syntax
1 parent bc0e891 commit 049f1dd

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

mongo/client_encryption.go

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -211,18 +211,12 @@ func (ce *ClientEncryption) CreateDataKey(
211211
func transformExplicitEncryptionOptions(opts ...options.Lister[options.EncryptOptions]) *mcopts.ExplicitEncryptionOptions {
212212
args, _ := mongoutil.NewOptions[options.EncryptOptions](opts...)
213213

214-
transformed := &mcopts.ExplicitEncryptionOptions{}
215-
if args.KeyID != nil {
216-
transformed.KeyID = args.KeyID
217-
}
218-
if args.KeyAltName != nil {
219-
transformed.KeyAltName = args.KeyAltName
220-
}
221-
transformed.Algorithm = args.Algorithm
222-
transformed.QueryType = args.QueryType
223-
224-
if args.ContentionFactor != nil {
225-
transformed.ContentionFactor = args.ContentionFactor
214+
transformed := &mcopts.ExplicitEncryptionOptions{
215+
KeyID: args.KeyID,
216+
KeyAltName: args.KeyAltName,
217+
Algorithm: args.Algorithm,
218+
QueryType: args.QueryType,
219+
ContentionFactor: args.ContentionFactor,
226220
}
227221

228222
if args.RangeOptions != nil {

0 commit comments

Comments
 (0)