Krolyxon
Commit 87f4837

rmptui87f4837

change String to &str in get_full_path()

Author
krolxon
Date
2024-06-04 15:24 +0530
Parent
1bf5805
Commit
87f4837fa17cee570a72ef7af0b873057a340ff3

+2 −2

1 file changed

  1. M src/connection.rs +2 −2
M src/connection.rs View
@@ -157,10 +157,10 @@ impl Connection {
157157 }
158158
159159 /// Given a song name from a directory, it returns the full path of the song in the database
160− pub fn get_full_path(&self, short_path: &str) -> Option<String> {
160+ pub fn get_full_path(&self, short_path: &str) -> Option<&str> {
161161 for (i, f) in self.songs_filenames.iter().enumerate() {
162162 if f.contains(short_path) {
163− return Some(self.songs_filenames.get(i).unwrap().to_string());
163+ return Some(self.songs_filenames.get(i).unwrap());
164164 }
165165 }
166166 None