fn read_from_file<P: AsRef<Path>>(&self, path: P) -> Result<String, Self::Error> {
        let mut file = File::open(path)?;
        let mut buffer = String::new();

        file.read_to_string(&mut buffer)?;

        if self.trim {
            buffer = buffer.trim().to_string();
        }

        Ok(buffer)
    }
/// Takes a file path and tries to read the file content into a `String`.
///
/// # Failures
/// Returns an error if the specified file cannot be opened or contains invalid UTF-8.
Takes a file path and tries to read the file content into a `String`.
Takes a file path and tries to read the file content into a ` String ` .
fn read_from_file<P: AsRef<Path>>(&self, path: P) -> Result<String, Self::Error> {
        let mut file = File::open(path)?;
        let mut buffer = String::new();
        file.read_to_string(&mut buffer)?;
        if self.trim {
            buffer = buffer.trim().to_string();
        }
        Ok(buffer)
    }
fn read_from_file < P : AsRef < Path > > ( & self , path : P ) -> Result < String , Self :: Error > { let mut file = File :: open ( path ) ? ; let mut buffer = String :: new ( ) ; file . read_to_string ( & mut buffer ) ? ; if self . trim { buffer = buffer . trim ( ) . to_string ( ) ; } Ok ( buffer ) }
Takes a file path and tries to read the file content into a `String`.
Takes a file path and tries to read the file content into a ` String ` .
&self
path
P
&self
path
P
failures
Returns an error if the specified file cannot be opened or contains invalid UTF-8.
Returns an error if the specified file cannot be opened or contains invalid UTF - 8 .