mirror of https://github.com/lapce/lapce.git
Remove load_rope
This commit is contained in:
parent
baa0e63bd0
commit
f195f25eed
|
@ -23,11 +23,7 @@ pub struct Buffer {
|
|||
|
||||
impl Buffer {
|
||||
pub fn new(id: BufferId, path: PathBuf) -> Buffer {
|
||||
let rope = if let Ok(rope) = load_rope(&path) {
|
||||
rope
|
||||
} else {
|
||||
Rope::from("")
|
||||
};
|
||||
let rope = Rope::from(load_file(&path).unwrap_or_default());
|
||||
let rev = if rope.is_empty() { 0 } else { 1 };
|
||||
let language_id = language_id_from_path(&path).unwrap_or("");
|
||||
let mod_time = get_mod_time(&path);
|
||||
|
@ -149,10 +145,6 @@ pub fn load_file(path: &Path) -> Result<String> {
|
|||
Ok(read_path_to_string_lossy(path)?)
|
||||
}
|
||||
|
||||
fn load_rope(path: &Path) -> Result<Rope> {
|
||||
Ok(Rope::from(read_path_to_string_lossy(path)?))
|
||||
}
|
||||
|
||||
pub fn read_path_to_string_lossy<P: AsRef<Path>>(
|
||||
path: P,
|
||||
) -> Result<String, std::io::Error> {
|
||||
|
|
Loading…
Reference in New Issue