Skip to content

Commit

Permalink
fix: remove SysTime serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
tirithen committed Mar 11, 2020
1 parent 4adcc91 commit 2c5acfd
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions data/vibe/data/bson.d
Original file line number Diff line number Diff line change
Expand Up @@ -423,11 +423,6 @@ struct Bson {
else static if( is(T == BsonObjectID) ){ checkType(Type.objectID); return BsonObjectID(m_data[0 .. 12]); }
else static if( is(T == bool) ){ checkType(Type.bool_); return m_data[0] != 0; }
else static if( is(T == BsonDate) ){ checkType(Type.date); return BsonDate(fromBsonData!long(m_data)); }
else static if( is(T == SysTime) ){
checkType(Type.date);
string data = cast(string)m_data[4 .. 4+fromBsonData!int(m_data)-1];
return SysTime.fromISOString(data);
}
else static if( is(T == BsonRegex) ){
checkType(Type.regex);
auto d = m_data[0 .. $];
Expand All @@ -449,10 +444,6 @@ struct Bson {
const ubyte[16] b = bbd.rawData;
return UUID(b);
}
else static if (is(T == SysTime)) {
checkType(Type.date);
return BsonDate(fromBsonData!long(m_data)).toSysTime();
}
else static assert(false, "Cannot cast "~typeof(this).stringof~" to '"~T.stringof~"'.");
}

Expand Down

0 comments on commit 2c5acfd

Please sign in to comment.