rmptui87f4837
change String to &str in get_full_path()
+2 −2
1 file changed
- M src/connection.rs +2 −2
| @@ -157,10 +157,10 @@ impl Connection { | |||
| 157 | 157 | } | |
| 158 | 158 | ||
| 159 | 159 | /// 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> { | |
| 161 | 161 | for (i, f) in self.songs_filenames.iter().enumerate() { | |
| 162 | 162 | 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()); | |
| 164 | 164 | } | |
| 165 | 165 | } | |
| 166 | 166 | None | |