Code formatting
This commit is contained in:
14
src/meta.rs
14
src/meta.rs
@@ -247,16 +247,16 @@ pub mod metadata {
|
|||||||
|
|
||||||
pub fn parse_value(value: types::MetadataType) -> String {
|
pub fn parse_value(value: types::MetadataType) -> String {
|
||||||
match value {
|
match value {
|
||||||
types::MetadataType::String(val) => {
|
types::MetadataType::String(val) => val,
|
||||||
val
|
types::MetadataType::Int(val) => val.to_string(),
|
||||||
}
|
|
||||||
types::MetadataType::Int(val) => {
|
|
||||||
val.to_string()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_meta_value(t: types::Type, filepath: &String, value: types::MetadataType) -> Result<String, std::io::Error> {
|
pub fn set_meta_value(
|
||||||
|
t: types::Type,
|
||||||
|
filepath: &String,
|
||||||
|
value: types::MetadataType,
|
||||||
|
) -> Result<String, std::io::Error> {
|
||||||
let parsed_val = parse_value(value);
|
let parsed_val = parse_value(value);
|
||||||
|
|
||||||
set_meta(t, filepath, &parsed_val)
|
set_meta(t, filepath, &parsed_val)
|
||||||
|
@@ -15,7 +15,7 @@ pub enum Type {
|
|||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub enum MetadataType {
|
pub enum MetadataType {
|
||||||
String(String),
|
String(String),
|
||||||
Int(i32)
|
Int(i32),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl MetadataType {
|
impl MetadataType {
|
||||||
@@ -32,9 +32,7 @@ impl MetadataType {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
pub mod access {
|
pub mod access {
|
||||||
|
|
||||||
pub fn get_type(t: super::Type) -> Result<String, std::io::Error> {
|
pub fn get_type(t: super::Type) -> Result<String, std::io::Error> {
|
||||||
match t {
|
match t {
|
||||||
super::Type::Title => Ok("TITLE".to_owned()),
|
super::Type::Title => Ok("TITLE".to_owned()),
|
||||||
|
Reference in New Issue
Block a user