More changes
Some checks failed
Rust Build / Check (pull_request) Failing after 25s
Rust Build / Test Suite (pull_request) Failing after 25s
Rust Build / Rustfmt (pull_request) Successful in 24s
Rust Build / Clippy (pull_request) Failing after 25s
Rust Build / build (pull_request) Failing after 25s
Some checks failed
Rust Build / Check (pull_request) Failing after 25s
Rust Build / Test Suite (pull_request) Failing after 25s
Rust Build / Rustfmt (pull_request) Successful in 24s
Rust Build / Clippy (pull_request) Failing after 25s
Rust Build / build (pull_request) Failing after 25s
This commit is contained in:
@@ -111,7 +111,7 @@ impl Song {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let directory = &self.directory;
|
let directory = &self.directory;
|
||||||
let mut buffer: String = String::from(directory.clone());
|
let mut buffer: String = directory.clone();
|
||||||
let last_index = directory.len() - 1;
|
let last_index = directory.len() - 1;
|
||||||
|
|
||||||
if let Some(character) = directory.chars().nth(last_index) {
|
if let Some(character) = directory.chars().nth(last_index) {
|
||||||
@@ -139,7 +139,7 @@ impl Song {
|
|||||||
let mut buffer: Vec<u8> = Vec::new();
|
let mut buffer: Vec<u8> = Vec::new();
|
||||||
file.read_to_end(&mut buffer)?;
|
file.read_to_end(&mut buffer)?;
|
||||||
|
|
||||||
if buffer.len() == 0 {
|
if buffer.is_empty() {
|
||||||
Err(std::io::Error::new(
|
Err(std::io::Error::new(
|
||||||
std::io::ErrorKind::Other,
|
std::io::ErrorKind::Other,
|
||||||
"File is empty",
|
"File is empty",
|
||||||
@@ -215,7 +215,7 @@ mod embedded {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let directory = &self.directory;
|
let directory = &self.directory;
|
||||||
let mut buffer: String = String::from(directory.clone());
|
let mut buffer: String = directory.clone();
|
||||||
let last_index = directory.len() - 1;
|
let last_index = directory.len() - 1;
|
||||||
|
|
||||||
if let Some(character) = directory.chars().nth(last_index) {
|
if let Some(character) = directory.chars().nth(last_index) {
|
||||||
@@ -243,7 +243,7 @@ mod embedded {
|
|||||||
let mut buffer: Vec<u8> = Vec::new();
|
let mut buffer: Vec<u8> = Vec::new();
|
||||||
file.read_to_end(&mut buffer)?;
|
file.read_to_end(&mut buffer)?;
|
||||||
|
|
||||||
if buffer.len() == 0 {
|
if buffer.is_empty() {
|
||||||
return Err(std::io::Error::new(
|
return Err(std::io::Error::new(
|
||||||
std::io::ErrorKind::Other,
|
std::io::ErrorKind::Other,
|
||||||
"File is empty",
|
"File is empty",
|
||||||
|
@@ -52,9 +52,9 @@ impl Default for User {
|
|||||||
impl User {
|
impl User {
|
||||||
pub fn to_json(&self, output_pretty: bool) -> Result<String, serde_json::Error> {
|
pub fn to_json(&self, output_pretty: bool) -> Result<String, serde_json::Error> {
|
||||||
if output_pretty {
|
if output_pretty {
|
||||||
return serde_json::to_string_pretty(&self);
|
serde_json::to_string_pretty(&self)
|
||||||
} else {
|
} else {
|
||||||
return serde_json::to_string(&self);
|
serde_json::to_string(&self)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user