mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 13:45:20 +00:00
misc: Remove redundant pub keyword of helper functions
Functions marked as `pub` in test module need to be documented. Since these are literally helper functions and there is no need to be `pub`, remove these `pub` keywords. Signed-off-by: Ruoqing He <heruoqing@iscas.ac.cn>
This commit is contained in:
parent
416fe5eaac
commit
b708db393d
@ -309,12 +309,12 @@ pub(crate) mod tests {
|
|||||||
use crate::{TokenBucket, TokenType, REFILL_TIMER_INTERVAL_MS};
|
use crate::{TokenBucket, TokenType, REFILL_TIMER_INTERVAL_MS};
|
||||||
|
|
||||||
impl RateLimiterGroupHandle {
|
impl RateLimiterGroupHandle {
|
||||||
pub fn bandwidth(&self) -> Option<TokenBucket> {
|
fn bandwidth(&self) -> Option<TokenBucket> {
|
||||||
let guard = self.inner.rate_limiter.inner.lock().unwrap();
|
let guard = self.inner.rate_limiter.inner.lock().unwrap();
|
||||||
guard.bandwidth.clone()
|
guard.bandwidth.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn ops(&self) -> Option<TokenBucket> {
|
fn ops(&self) -> Option<TokenBucket> {
|
||||||
let guard = self.inner.rate_limiter.inner.lock().unwrap();
|
let guard = self.inner.rate_limiter.inner.lock().unwrap();
|
||||||
guard.ops.clone()
|
guard.ops.clone()
|
||||||
}
|
}
|
||||||
|
@ -544,7 +544,8 @@ pub(crate) mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// After a restore, we cannot be certain that the last_update field has the same value.
|
// After a restore, we cannot be certain that the last_update field has the same value.
|
||||||
pub fn partial_eq(&self, other: &TokenBucket) -> bool {
|
#[allow(dead_code)]
|
||||||
|
fn partial_eq(&self, other: &TokenBucket) -> bool {
|
||||||
(other.capacity() == self.capacity())
|
(other.capacity() == self.capacity())
|
||||||
&& (other.one_time_burst() == self.one_time_burst())
|
&& (other.one_time_burst() == self.one_time_burst())
|
||||||
&& (other.refill_time_ms() == self.refill_time_ms())
|
&& (other.refill_time_ms() == self.refill_time_ms())
|
||||||
@ -553,12 +554,12 @@ pub(crate) mod tests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl RateLimiter {
|
impl RateLimiter {
|
||||||
pub fn bandwidth(&self) -> Option<TokenBucket> {
|
fn bandwidth(&self) -> Option<TokenBucket> {
|
||||||
let guard = self.inner.lock().unwrap();
|
let guard = self.inner.lock().unwrap();
|
||||||
guard.bandwidth.clone()
|
guard.bandwidth.clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn ops(&self) -> Option<TokenBucket> {
|
fn ops(&self) -> Option<TokenBucket> {
|
||||||
let guard = self.inner.lock().unwrap();
|
let guard = self.inner.lock().unwrap();
|
||||||
guard.ops.clone()
|
guard.ops.clone()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user