rustjail: Fix minor grammatical error in function name

Rename `unit_exist` function to `unit_exists` to match English grammar rule.

Fixes: #6561

Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
This commit is contained in:
Christophe de Dinechin 2023-03-30 16:13:37 +02:00
parent 41fdda1d84
commit 7796e6ccc6
2 changed files with 3 additions and 3 deletions

View File

@ -26,7 +26,7 @@ pub trait SystemdInterface {
fn get_version(&self) -> Result<String>;
fn unit_exist(&self, unit_name: &str) -> Result<bool>;
fn unit_exists(&self, unit_name: &str) -> Result<bool>;
fn add_process(&self, pid: i32, unit_name: &str) -> Result<()>;
}
@ -108,7 +108,7 @@ impl SystemdInterface for DBusClient {
Ok(systemd_version)
}
fn unit_exist(&self, unit_name: &str) -> Result<bool> {
fn unit_exists(&self, unit_name: &str) -> Result<bool> {
let proxy = self.build_proxy()?;
Ok(proxy.get_unit(unit_name).is_ok())

View File

@ -41,7 +41,7 @@ pub struct Manager {
impl CgroupManager for Manager {
fn apply(&self, pid: pid_t) -> Result<()> {
let unit_name = self.unit_name.as_str();
if self.dbus_client.unit_exist(unit_name)? {
if self.dbus_client.unit_exists(unit_name)? {
self.dbus_client.add_process(pid, self.unit_name.as_str())?;
} else {
self.dbus_client.start_unit(