Skip to content

Commit

Permalink
👕 format code
Browse files Browse the repository at this point in the history
  • Loading branch information
ChanTsune committed Oct 9, 2023
1 parent 7300b98 commit 15bd5b6
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions lib/src/archive/entry/meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ impl Permission {
/// ```
/// use libpna::Permission;
///
/// let perm = Permission::new(1000, "user".to_string(), 100, "group".to_string(), 0o755);
/// let perm = Permission::new(1000, "user".to_owned(), 100, "group".to_owned(), 0o755);
/// ```
#[inline]
pub const fn new(uid: u64, uname: String, gid: u64, gname: String, permission: u16) -> Self {
Expand All @@ -78,7 +78,7 @@ impl Permission {
/// ```
/// use libpna::Permission;
///
/// let perm = Permission::new(1000, String::from("user1"), 100, String::from("group1"), 0o644);
/// let perm = Permission::new(1000, "user1".to_owned(), 100, "group1".to_owned(), 0o644);
/// assert_eq!(perm.uid(), 1000);
/// ```
#[inline]
Expand All @@ -93,7 +93,7 @@ impl Permission {
/// ```
/// use libpna::Permission;
///
/// let perm = Permission::new(1000, String::from("user1"), 100, String::from("group1"), 0o644);
/// let perm = Permission::new(1000, "user1".to_owned(), 100, "group1".to_owned(), 0o644);
/// assert_eq!(perm.uname(), "user1");
/// ```
#[inline]
Expand All @@ -108,7 +108,7 @@ impl Permission {
/// ```
/// use libpna::Permission;
///
/// let perm = Permission::new(1000, String::from("user1"), 100, String::from("group1"), 0o644);
/// let perm = Permission::new(1000, "user1".to_owned(), 100, "group1".to_owned(), 0o644);
/// assert_eq!(perm.gid(), 100);
/// ```
#[inline]
Expand All @@ -123,7 +123,7 @@ impl Permission {
/// ```
/// use libpna::Permission;
///
/// let perm = Permission::new(1000, String::from("user1"), 100, String::from("group1"), 0o644);
/// let perm = Permission::new(1000, "user1".to_owned(), 100, "group1".to_owned(), 0o644);
/// assert_eq!(perm.gname(), "group1");
/// ```
#[inline]
Expand All @@ -138,7 +138,7 @@ impl Permission {
/// ```
/// use libpna::Permission;
///
/// let perm = Permission::new(1000, String::from("user1"), 100, String::from("group1"), 0o644);
/// let perm = Permission::new(1000, "user1".to_owned(), 100, "group1".to_owned(), 0o644);
/// assert_eq!(perm.permissions(), 0o644);
/// ```
#[inline]
Expand Down Expand Up @@ -212,13 +212,7 @@ mod tests {

#[test]
fn permission() {
let perm = Permission::new(
1000,
String::from("user1"),
100,
String::from("group1"),
0o644,
);
let perm = Permission::new(1000, "user1".to_owned(), 100, "group1".to_owned(), 0o644);
assert_eq!(perm, Permission::try_from_bytes(&perm.to_bytes()).unwrap());
}
}

0 comments on commit 15bd5b6

Please sign in to comment.