Skip to content

Commit

Permalink
fix typespec for new/4
Browse files Browse the repository at this point in the history
  • Loading branch information
the-mikedavis committed Jul 6, 2021
1 parent 99c7cd5 commit 3e12591
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ The format is based on [Keep a
Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.1.4 - 2021-07-06

### Fixed

- Fixed typespec for `Mint.WebSocket.new/4`

## 0.1.3 - 2021-07-02

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions lib/mint/web_socket.ex
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,8 @@ defmodule Mint.WebSocket do
Mint.WebSocket.new(conn, ref, status, resp_headers)
```
"""
@spec new(Mint.HTTP.t(), reference(), pos_integer(), Mint.Types.headers()) ::
{:ok, Mint.HTTP.t(), t(), [Mint.Types.response()]} | {:error, Mint.HTTP.t(), error()}
@spec new(Mint.HTTP.t(), reference(), Mint.Types.status(), Mint.Types.headers()) ::
{:ok, Mint.HTTP.t(), t()} | {:error, Mint.HTTP.t(), error()}
def new(%Mint.HTTP1{} = conn, _request_ref, status, _response_headers)
when status != 101 do
{:error, conn, %WebSocketError{reason: :connection_not_upgraded}}
Expand Down

0 comments on commit 3e12591

Please sign in to comment.