Skip to content

Commit

Permalink
Mark as readonly
Browse files Browse the repository at this point in the history
  • Loading branch information
domsleee committed Sep 25, 2023
1 parent 61ed6b8 commit 60a2ebc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/meta/permissions_or_attributes.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#[cfg(windows)]
use super::windows_attributes::WindowsAttributes;
use crate::{
color::{ColoredString, Colors},
flags::Flags,
};

use super::{windows_attributes::WindowsAttributes, Permissions};
use super::Permissions;

#[derive(Clone, Debug)]
pub enum PermissionsOrAttributes {
Expand All @@ -16,6 +18,7 @@ impl PermissionsOrAttributes {
pub fn render(&self, colors: &Colors, flags: &Flags) -> ColoredString {
match self {
PermissionsOrAttributes::Permissions(permissions) => permissions.render(colors, flags),
#[cfg(windows)]
PermissionsOrAttributes::WindowsAttributes(attributes) => {
attributes.render(colors, flags)
}
Expand Down
3 changes: 3 additions & 0 deletions src/meta/windows_attributes.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#[cfg(windows)]
use crate::{
color::{ColoredString, Colors, Elem},
flags::Flags,
};
#[cfg(windows)]
use std::os::windows::fs::MetadataExt;

#[cfg(windows)]
#[derive(Debug, Clone)]
pub struct WindowsAttributes {
pub archive: bool,
Expand All @@ -27,6 +29,7 @@ pub fn get_attributes(metadata: &std::fs::Metadata) -> WindowsAttributes {
}
}

#[cfg(windows)]
impl WindowsAttributes {
pub fn render(&self, colors: &Colors, _flags: &Flags) -> ColoredString {
let res = [
Expand Down

0 comments on commit 60a2ebc

Please sign in to comment.