Not only would this fix issues with the old server, it also future proofs the client for servers in the wild that may default to newer protocol versions than are supported. Plus it can give specific error messages when there's a compatibility issue.
Update, BTG specifically is unlikely to work without changes to the bitcoin crate, as they've substantially changed the block header format. That said, it may still be an interesting forward compatibility feature.
Trying to connect to a BTG server at
tcp://electrumx-eu.bitcoingold.org:50001
I found the server is rather old.Because of this, it defaults to Electrum protocol
1.2
which isn't compatible with this client. We can negotiate version1.4
though, as per https://electrumx.readthedocs.io/en/latest/protocol-basics.html#version-negotiationNot only would this fix issues with the old server, it also future proofs the client for servers in the wild that may default to newer protocol versions than are supported. Plus it can give specific error messages when there's a compatibility issue.