Skip to content
This repository was archived by the owner on Oct 8, 2025. It is now read-only.

Commit f748851

Browse files
committed
Rust/rusty: Re-order some functions more logically
This may not matter in rust (if you use a function before the compiler has seen a definition for it), but anyway in preparation for adding a uwr_get_http_total_content_sent() function, put the content length related functions before the functions that return the content. Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
1 parent 59cb1e8 commit f748851

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/rust/unit-wasm-sys/rusty.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,18 @@ pub fn uwr_get_http_server_name(ctx: *const luw_ctx_t) -> &'static str {
9595
C2S!(luw_get_http_server_name(ctx))
9696
}
9797

98-
pub fn uwr_get_http_content(ctx: *const luw_ctx_t) -> *const u8 {
99-
unsafe { luw_get_http_content(ctx) }
100-
}
101-
10298
pub fn uwr_get_http_content_len(ctx: *const luw_ctx_t) -> usize {
10399
unsafe { luw_get_http_content_len(ctx) }
104100
}
105101

102+
pub fn uwr_get_http_content_sent(ctx: *const luw_ctx_t) -> usize {
103+
unsafe { luw_get_http_content_sent(ctx) }
104+
}
105+
106+
pub fn uwr_get_http_content(ctx: *const luw_ctx_t) -> *const u8 {
107+
unsafe { luw_get_http_content(ctx) }
108+
}
109+
106110
pub fn uwr_get_http_content_str(ctx: *const luw_ctx_t) -> &'static str {
107111
unsafe {
108112
let slice = slice::from_raw_parts(
@@ -113,10 +117,6 @@ pub fn uwr_get_http_content_str(ctx: *const luw_ctx_t) -> &'static str {
113117
}
114118
}
115119

116-
pub fn uwr_get_http_content_sent(ctx: *const luw_ctx_t) -> usize {
117-
unsafe { luw_get_http_content_sent(ctx) }
118-
}
119-
120120
pub fn uwr_http_is_tls(ctx: *const luw_ctx_t) -> bool {
121121
unsafe { luw_http_is_tls(ctx) }
122122
}

0 commit comments

Comments
 (0)