Skip to content

Commit

Permalink
fix: drop unnecessary casts from usize to size_t
Browse files Browse the repository at this point in the history
`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.
  • Loading branch information
bavshin-f5 committed Oct 23, 2024
1 parent e91556a commit 8b6aa4b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions nginx-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ impl ngx_str_t {
pub unsafe fn from_string(pool: *mut ngx_pool_t, data: String) -> Self {
ngx_str_t {
data: str_to_uchar(pool, data.as_str()),
len: data.len() as _,
len: data.len(),
}
}

Expand All @@ -183,7 +183,7 @@ impl ngx_str_t {
pub unsafe fn from_str(pool: *mut ngx_pool_t, data: &str) -> Self {
ngx_str_t {
data: str_to_uchar(pool, data),
len: data.len() as _,
len: data.len(),
}
}
}
Expand Down Expand Up @@ -254,9 +254,9 @@ pub unsafe fn add_to_ngx_table(
}
table.as_mut().map(|table| {
table.hash = 1;
table.key.len = key.len() as _;
table.key.len = key.len();
table.key.data = str_to_uchar(pool, key);
table.value.len = value.len() as _;
table.value.len = value.len();
table.value.data = str_to_uchar(pool, value);
table.lowcase_key = str_to_uchar(pool, String::from(key).to_ascii_lowercase().as_str());
})
Expand Down

0 comments on commit 8b6aa4b

Please sign in to comment.