Might as well use the From trait
This commit is contained in:
parent
7668a19490
commit
2f2143967b
1 changed files with 2 additions and 2 deletions
|
|
@ -24,8 +24,8 @@ pub struct PositionAndSize {
|
|||
pub columns: usize,
|
||||
}
|
||||
|
||||
impl PositionAndSize {
|
||||
pub fn from(winsize: Winsize) -> PositionAndSize {
|
||||
impl From<Winsize> for PositionAndSize {
|
||||
fn from(winsize: Winsize) -> PositionAndSize {
|
||||
PositionAndSize {
|
||||
columns: winsize.ws_col as usize,
|
||||
rows: winsize.ws_row as usize,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue