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

This commit is contained in:
2025-03-21 21:55:15 -04:00
parent deb39dbfdc
commit d9bc2c5d09
2 changed files with 6 additions and 6 deletions

View File

@@ -111,7 +111,7 @@ impl Song {
}
let directory = &self.directory;
let mut buffer: String = String::from(directory.clone());
let mut buffer: String = directory.clone();
let last_index = directory.len() - 1;
if let Some(character) = directory.chars().nth(last_index) {
@@ -139,7 +139,7 @@ impl Song {
let mut buffer: Vec<u8> = Vec::new();
file.read_to_end(&mut buffer)?;
if buffer.len() == 0 {
if buffer.is_empty() {
Err(std::io::Error::new(
std::io::ErrorKind::Other,
"File is empty",
@@ -215,7 +215,7 @@ mod embedded {
}
let directory = &self.directory;
let mut buffer: String = String::from(directory.clone());
let mut buffer: String = directory.clone();
let last_index = directory.len() - 1;
if let Some(character) = directory.chars().nth(last_index) {
@@ -243,7 +243,7 @@ mod embedded {
let mut buffer: Vec<u8> = Vec::new();
file.read_to_end(&mut buffer)?;
if buffer.len() == 0 {
if buffer.is_empty() {
return Err(std::io::Error::new(
std::io::ErrorKind::Other,
"File is empty",

View File

@@ -52,9 +52,9 @@ impl Default for User {
impl User {
pub fn to_json(&self, output_pretty: bool) -> Result<String, serde_json::Error> {
if output_pretty {
return serde_json::to_string_pretty(&self);
serde_json::to_string_pretty(&self)
} else {
return serde_json::to_string(&self);
serde_json::to_string(&self)
}
}
}