mirror of
https://github.com/sayanarijit/xplr
synced 2024-11-10 07:10:45 +00:00
Remove trivial ResolvedNode
methods
This commit is contained in:
parent
95b580203f
commit
402715cdcd
40
src/app.rs
40
src/app.rs
@ -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)]
|
||||
|
16
src/ui.rs
16
src/ui.rs
@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user