Skip to content

Commit

Permalink
use Buffer::new_empty in Buffer::new
Browse files Browse the repository at this point in the history
  • Loading branch information
tigregalis committed May 12, 2023
1 parent 550ac0a commit 98cfc86
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,17 +344,7 @@ impl Buffer {
///
/// Will panic if `metrics.line_height` is zero.
pub fn new(font_system: &mut FontSystem, metrics: Metrics) -> Self {
assert_ne!(metrics.line_height, 0.0, "line height cannot be 0");

let mut buffer = Self {
lines: Vec::new(),
metrics,
width: 0.0,
height: 0.0,
scroll: 0,
redraw: false,
wrap: Wrap::Word,
};
let mut buffer = Self::new_empty(metrics);
buffer.set_text(font_system, "", Attrs::new());
buffer
}
Expand Down

0 comments on commit 98cfc86

Please sign in to comment.