aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2020-03-17 01:50:27 +0100
committerGitHub <noreply@github.com>2020-03-17 00:50:27 +0000
commitb48e2fc2d813723ac73030b2e8f5a21ad5fd37ed (patch)
tree16a68cb106b9d4bcab1dbf39adffa181babd9818
parente2725721686627c976f16d513bb12fe7a303c587 (diff)
downloadalacritty-b48e2fc2d813723ac73030b2e8f5a21ad5fd37ed.tar.gz
alacritty-b48e2fc2d813723ac73030b2e8f5a21ad5fd37ed.zip
Remove std::fs::read_to_string reimplementation
-rw-r--r--alacritty/src/renderer/mod.rs14
1 files changed, 3 insertions, 11 deletions
diff --git a/alacritty/src/renderer/mod.rs b/alacritty/src/renderer/mod.rs
index a099b0de..4526020a 100644
--- a/alacritty/src/renderer/mod.rs
+++ b/alacritty/src/renderer/mod.rs
@@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use std::collections::HashMap;
-use std::fs::File;
+use std::fs;
use std::hash::BuildHasherDefault;
-use std::io::{self, Read};
+use std::io;
use std::mem::size_of;
use std::path::PathBuf;
use std::ptr;
@@ -1321,7 +1321,7 @@ fn create_shader(
let source = if let Some(src) = source {
src
} else {
- from_disk = read_file(path)?;
+ from_disk = fs::read_to_string(path)?;
&from_disk[..]
};
@@ -1400,14 +1400,6 @@ fn get_shader_info_log(shader: GLuint) -> String {
String::from_utf8(buf).unwrap()
}
-fn read_file(path: &str) -> Result<String, io::Error> {
- let mut f = File::open(path)?;
- let mut buf = String::new();
- f.read_to_string(&mut buf)?;
-
- Ok(buf)
-}
-
#[derive(Debug)]
pub enum ShaderCreationError {
/// Error reading file