rust-client
rust-client copied to clipboard
refactor: Enhance URL handling in QdrantClientConfig
This commit improves the URL handling mechanism in the QdrantClientConfig's from_url function. The primary aim is to ensure that the Qdrant service URL is always fully specified, including a default port if one is not provided in the input URL. This enhancement makes the client's connection setup more robust and error-tolerant, especially in environments where the port might not be explicitly specified.
Changes include:
- Parsing the input URL using the
urlcrate to create aUrlinstance. - Checking for the presence of a port in the parsed URL. If absent, the default port 6334 is assigned.
These modifications ensure that the QdrantClientConfig is initialized with a complete URL, reducing the potential for runtime errors during the client's interaction with the Qdrant service.