Skip to content

Commit 3dd7ea5

Browse files
committed
fix: mark Request.get_module_loc_conf result as static.
The main/server/location configuration objects belong to the cycle and will exist until the worker process is exiting. `'static` should help the compiler understand that we're returning a global object instead of borrowing from the `Request`.
1 parent 8b6aa4b commit 3dd7ea5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/http/request.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ impl Request {
151151
}
152152

153153
/// Module location configuration.
154-
pub fn get_module_loc_conf<T>(&self, module: &ngx_module_t) -> Option<&T> {
154+
pub fn get_module_loc_conf<T>(&self, module: &ngx_module_t) -> Option<&'static T> {
155155
let lc_prt = self.get_module_loc_conf_ptr(module) as *mut T;
156156
if lc_prt.is_null() {
157157
return None;

0 commit comments

Comments
 (0)