Xuanwo opened a new issue, #5976: URL: https://github.com/apache/opendal/issues/5976
In opendal's code, there are many places need to build query pairs: https://github.com/apache/opendal/blob/55ad6136bc28f1e3758078b16eceb3a0da9953f8/core/src/services/s3/core.rs#L725-L751 However, many of them are poorly implemented, require unnecessary error handling, or consume additional memory. This refactor intended to use newly added `QueryPairsWriter` to replace them all: ```diff - let mut url = format!("{}?list-type=2", self.endpoint); - if !p.is_empty() { - write!(url, "&prefix={}", percent_encode_path(&p)) - .expect("write into string must succeed"); - } + let mut url = QueryPairsWriter::new(&self.endpoint); + url = url.push("list-type", "2"); + if !p.is_empty() { + url = url.push("prefix", &percent_encode_path(&p)); + } ``` Take #xxx as a full example. We don't need to replace every query build—only those with more than three query pairs, such as the list object operations. -- 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]
