Fix code quality: trailing whitespace, unused imports, clippy warnings
- Fix trailing whitespace in kex.rs and s3.rs - Add missing KexProposal import in kex_complete.rs - Auto-fix clippy warnings across all crates - All 153 tests pass
This commit is contained in:
@@ -4,16 +4,18 @@ use serde_json::Value;
|
||||
pub fn list_buckets_xml(buckets: &[String]) -> (HeaderMap, String) {
|
||||
let mut headers = HeaderMap::new();
|
||||
headers.insert("Content-Type", "application/xml".parse().unwrap());
|
||||
|
||||
|
||||
let bucket_entries = buckets
|
||||
.iter()
|
||||
.map(|b| format!(
|
||||
"<Bucket><Name>{}</Name><CreationDate>2026-05-27T00:00:00Z</CreationDate></Bucket>",
|
||||
b
|
||||
))
|
||||
.map(|b| {
|
||||
format!(
|
||||
"<Bucket><Name>{}</Name><CreationDate>2026-05-27T00:00:00Z</CreationDate></Bucket>",
|
||||
b
|
||||
)
|
||||
})
|
||||
.collect::<Vec<_>>()
|
||||
.join("\n ");
|
||||
|
||||
|
||||
let xml = format!(
|
||||
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>
|
||||
<ListAllMyBucketsResult xmlns=\"http://s3.amazonaws.com/doc/2006-03-01/\">
|
||||
@@ -27,22 +29,25 @@ pub fn list_buckets_xml(buckets: &[String]) -> (HeaderMap, String) {
|
||||
</ListAllMyBucketsResult>",
|
||||
bucket_entries
|
||||
);
|
||||
|
||||
|
||||
(headers, xml)
|
||||
}
|
||||
|
||||
pub fn list_objects_xml(bucket_name: &str, objects: &[Value]) -> (HeaderMap, String) {
|
||||
let mut headers = HeaderMap::new();
|
||||
headers.insert("Content-Type", "application/xml".parse().unwrap());
|
||||
|
||||
|
||||
let object_entries = objects
|
||||
.iter()
|
||||
.map(|obj| {
|
||||
let key = obj.get("Key").and_then(|k| k.as_str()).unwrap_or("");
|
||||
let last_modified = obj.get("LastModified").and_then(|l| l.as_str()).unwrap_or("");
|
||||
let last_modified = obj
|
||||
.get("LastModified")
|
||||
.and_then(|l| l.as_str())
|
||||
.unwrap_or("");
|
||||
let etag = obj.get("ETag").and_then(|e| e.as_str()).unwrap_or("");
|
||||
let size = obj.get("Size").and_then(|s| s.as_i64()).unwrap_or(0);
|
||||
|
||||
|
||||
format!(
|
||||
"<Contents>
|
||||
<Key>{}</Key>
|
||||
@@ -55,7 +60,7 @@ pub fn list_objects_xml(bucket_name: &str, objects: &[Value]) -> (HeaderMap, Str
|
||||
})
|
||||
.collect::<Vec<_>>()
|
||||
.join("\n ");
|
||||
|
||||
|
||||
let xml = format!(
|
||||
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>
|
||||
<ListBucketResult xmlns=\"http://s3.amazonaws.com/doc/2006-03-01/\">
|
||||
@@ -68,6 +73,6 @@ pub fn list_objects_xml(bucket_name: &str, objects: &[Value]) -> (HeaderMap, Str
|
||||
</ListBucketResult>",
|
||||
bucket_name, object_entries
|
||||
);
|
||||
|
||||
|
||||
(headers, xml)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user