Skip to content

Change `RESPValue.init(bulk:)` initializers to accept a wider range of values

Nathan Harris requested to merge respvalue-nil-init into master

Motivation:

While working to add more test coverage with RESPTranslator, it was made apparent that a .bulkString(.none) is impossible to create directly with the RESPValue initializers, even though it is a reasonable possibility.

Additionally, forcing all integer types to have to be stored in an Int is unnecessarily restrictive.

Modifications:

  • Change RESPValue.init(bulk:) initializers to accept Optional instances
  • Change RESPValue.init(bulk:) for Int initializer to be generic on FixedWidthInteger

Result:

Converting types to and from RESPValue should be more bi-directional and seamless.

Merge request reports