Remove trivial ResolvedNode methods

This commit is contained in:
Gilad Woloch 2021-10-06 15:35:08 +03:00 committed by Arijit Basu
parent 95b580203f
commit 402715cdcd
2 changed files with 8 additions and 48 deletions

View File

@ -119,46 +119,6 @@ impl ResolvedNode {
human_size,
}
}
/// Get a reference to the resolved node's absolute path.
pub fn absolute_path(&self) -> &String {
&self.absolute_path
}
/// Get a reference to the resolved node's extension.
pub fn extension(&self) -> &String {
&self.extension
}
/// Get a reference to the resolved node's is dir.
pub fn is_dir(&self) -> bool {
self.is_dir
}
/// Get a reference to the resolved node's is file.
pub fn is_file(&self) -> bool {
self.is_file
}
/// Get a reference to the resolved node's is readonly.
pub fn is_readonly(&self) -> bool {
self.is_readonly
}
/// Get a reference to the resolved node's mime essence.
pub fn mime_essence(&self) -> &String {
&self.mime_essence
}
/// Get a reference to the resolved node's size.
pub fn size(&self) -> u64 {
self.size
}
/// Get a reference to the resolved node's human size.
pub fn human_size(&self) -> &String {
&self.human_size
}
}
#[derive(Debug, Clone, Eq, Hash, PartialEq, Serialize, Deserialize)]

View File

@ -317,14 +317,14 @@ pub struct ResolvedNodeUiMetadata {
impl From<ResolvedNode> for ResolvedNodeUiMetadata {
fn from(node: ResolvedNode) -> Self {
Self {
absolute_path: node.absolute_path().to_owned(),
extension: node.extension().to_owned(),
is_dir: node.is_dir(),
is_file: node.is_file(),
is_readonly: node.is_readonly(),
mime_essence: node.mime_essence().to_owned(),
size: node.size(),
human_size: node.human_size().to_owned(),
absolute_path: node.absolute_path.to_owned(),
extension: node.extension.to_owned(),
is_dir: node.is_dir,
is_file: node.is_file,
is_readonly: node.is_readonly,
mime_essence: node.mime_essence.to_owned(),
size: node.size,
human_size: node.human_size,
}
}
}