Skip to content

Commit

Permalink
style: fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
saidsay-so committed Sep 21, 2024
1 parent e0984e7 commit faf5a42
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions rust/src/config/auth.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::error::Error;
use std::{borrow::Cow, fmt::Display};
use std::process::exit;
use std::{borrow::Cow, fmt::Display};

use nix::unistd::{Group, User};
use serde::{de::Visitor, ser::SerializeTuple, Deserialize, Serialize};
Expand Down Expand Up @@ -145,11 +145,11 @@ impl Default for DummyAuthConfig {
},
DummyAuthEntry {
user: upjdfstest,
group: gpjdfstest
group: gpjdfstest,
},
DummyAuthEntry {
user: utests,
group: gtests
group: gtests,
},
],
}
Expand Down
6 changes: 3 additions & 3 deletions rust/src/tests/mod.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
//! Where the tests are defined.
//!
//!
//! This module contains the tests for the file system test suite. The tests are defined as functions
//! which are then registered with the test suite.
//!
//!
//! The tests are defined using the `test_case!` macro, which is used to define a test case for the test suite.
//!
//!
//! It also contains some helper functions and macros which are used to define the tests.
use std::fs::symlink_metadata;
Expand Down
4 changes: 2 additions & 2 deletions rust/src/tests/rmdir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ fn has_mount_cap(_: &Config, _: &Path) -> anyhow::Result<()> {
if !Uid::effective().is_root() && ctl.value()? == CtlValue::Int(0) {
anyhow::bail!("process doesn't have the rights to mount the dummy file system")
}
if !Uid::effective().is_root() &&
!OsStr::from_bytes(&Command::new("lsvfs").output().unwrap().stdout)
if !Uid::effective().is_root()
&& !OsStr::from_bytes(&Command::new("lsvfs").output().unwrap().stdout)
.to_string_lossy()
.contains("nullfs")
{
Expand Down
4 changes: 2 additions & 2 deletions rust/src/utils.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! Utility functions for filesystem operations.
//!
//!
//! This module provides utility functions for filesystem operations which are not available in the standard library.
use std::{
Expand Down Expand Up @@ -95,7 +95,7 @@ pub fn lchflags<P: ?Sized + nix::NixPath>(

/// Wrapper for open which returns [`Ownedfd`] instead of [`RawFd`].
pub fn open<P: ?Sized + nix::NixPath>(path: &P, oflag: OFlag, mode: Mode) -> nix::Result<OwnedFd> {
// SAFETY: The file descriptor was initialized only by open and isn't used anywhere else,
// SAFETY: The file descriptor was initialized only by open and isn't used anywhere else,
// leaving the ownership to the caller.
nix::fcntl::open(path, oflag, mode).map(|fd| unsafe { OwnedFd::from_raw_fd(fd) })
}

0 comments on commit faf5a42

Please sign in to comment.