Skip to content

Commit 8b6aa4b

Browse files
committed
fix: drop unnecessary casts from usize to size_t
`size_t` is transformed to `usize` by default since bindgen 0.61. As we require much newer version of bindgen, the explicit casts are no longer necessary.
1 parent e91556a commit 8b6aa4b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

nginx-sys/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ impl ngx_str_t {
162162
pub unsafe fn from_string(pool: *mut ngx_pool_t, data: String) -> Self {
163163
ngx_str_t {
164164
data: str_to_uchar(pool, data.as_str()),
165-
len: data.len() as _,
165+
len: data.len(),
166166
}
167167
}
168168

@@ -183,7 +183,7 @@ impl ngx_str_t {
183183
pub unsafe fn from_str(pool: *mut ngx_pool_t, data: &str) -> Self {
184184
ngx_str_t {
185185
data: str_to_uchar(pool, data),
186-
len: data.len() as _,
186+
len: data.len(),
187187
}
188188
}
189189
}
@@ -254,9 +254,9 @@ pub unsafe fn add_to_ngx_table(
254254
}
255255
table.as_mut().map(|table| {
256256
table.hash = 1;
257-
table.key.len = key.len() as _;
257+
table.key.len = key.len();
258258
table.key.data = str_to_uchar(pool, key);
259-
table.value.len = value.len() as _;
259+
table.value.len = value.len();
260260
table.value.data = str_to_uchar(pool, value);
261261
table.lowcase_key = str_to_uchar(pool, String::from(key).to_ascii_lowercase().as_str());
262262
})

0 commit comments

Comments
 (0)