slbotbm commented on code in PR #3733:
URL: https://github.com/apache/iggy/pull/3733#discussion_r3799169277
##########
foreign/cpp/src/client.rs:
##########
@@ -75,37 +77,86 @@ pub struct Client {
/// (use-after-free).
/// - This function does not provide synchronisation. The pointer must not be
used concurrently
/// from multiple threads unless the caller serialises access externally.
-pub fn new_connection(connection_string: String) -> Result<*mut Client,
String> {
- let connection_str = connection_string.as_str();
- let client = match connection_str {
- "" => RustIggyClientBuilder::new()
- .with_tcp()
- .build()
- .map_err(|error| format!("Could not build default connection:
{error}"))?,
- s if s.starts_with("iggy://") || s.starts_with("iggy+") => {
- RustIggyClient::from_connection_string(s)
- .map_err(|error| format!("Could not parse connection string
'{s}': {error}"))?
+pub fn new_connection(config: ffi::IggyClientConfig) -> Result<*mut Client,
String> {
+ let mut builder = RustIggyClientBuilder::new().with_tcp();
+ if !config.server_address.is_empty() {
Review Comment:
Empty strings are rejected on cpp side now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]