Skip to content

Commit

Permalink
Fix unused compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
tong committed Jul 6, 2023
1 parent 9aab7bb commit 5e1dbe4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/xmpp/Response.hx
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ abstract Response<T:xmpp.IQ.Payload>(EResponse<T>) from EResponse<T> to ERespons
public var payload(get,never) : T;
inline function get_payload() : T return switch this {
case Result(r): r;
case Error(e): null;
case Error(_): null;
}

/** The error **/
public var error(get,never) : xmpp.Stanza.Error;
inline function get_error() : xmpp.Stanza.Error return switch this {
case Result(r): null;
case Result(_): null;
case Error(e): e;
}

Expand All @@ -38,7 +38,7 @@ abstract Response<T:xmpp.IQ.Payload>(EResponse<T>) from EResponse<T> to ERespons
public var xmlns(get,never) : String;
inline function get_xmlns() : String return switch this {
case Result(r): r.get('xmlns');
case Error(e): null;
case Error(_): null;
}

inline function new(r:Response<T>) this = r;
Expand All @@ -64,11 +64,11 @@ abstract Response<T:xmpp.IQ.Payload>(EResponse<T>) from EResponse<T> to ERespons
case Result(r): r;
case Error(e): e.toXML();
}

@:to public inline function toOption():haxe.ds.Option<T>
return switch this {
case Result(r): haxe.ds.Option.Some(r);
case Error(e): haxe.ds.Option.None;
case Error(_): haxe.ds.Option.None;
}

@:from public static inline function fromError<T:xmpp.IQ.Payload>(e:xmpp.Stanza.Error):Response<T>
Expand Down

0 comments on commit 5e1dbe4

Please sign in to comment.