Hi and welcome, please read the following post on syntax highlighting and code blocks
Your program uses a buffer in each loop iteration that contains a line. The .trim_end() call creates a slice of that same buffer. This slice references / points into buffer and can’t be used anymore once buffer is dropped at the end of each loop iteration, hence it can’t be stored in line_input because line_input lives longer, throughout the whole loop over all the lines. A possible fix would be to give line_input the type Vec<String> (currently it’s Vec<&str>) by pushing an owned copy of parsed:
This can be done by writing line_input.push(parsed.to_owned()).
You can also avoid some allocations by re-using buffer if you want to. This can be done by moving let mut buffer = String::new(); outside of the loop and calling buffer.clear() on each iteration.