mirror of
https://github.com/starship/starship.git
synced 2026-06-23 02:05:51 +07:00
eb724279da
- Adds the git_state module. - Adds git_state to the default prompt order - Updates the documentation to describe the git_state module
13 lines
308 B
Rust
13 lines
308 B
Rust
use std::fs::File;
|
|
use std::io::{Read, Result};
|
|
use std::path::Path;
|
|
|
|
/// Return the string contents of a file
|
|
pub fn read_file<P: AsRef<Path>>(file_name: P) -> Result<String> {
|
|
let mut file = File::open(file_name)?;
|
|
let mut data = String::new();
|
|
|
|
file.read_to_string(&mut data)?;
|
|
Ok(data)
|
|
}
|