Accept bigger variety of paths for pager
This commit is contained in:
parent
c4ce04d700
commit
53870fecce
@ -1,9 +1,10 @@
|
|||||||
use std::{
|
use std::{
|
||||||
fs::{File, OpenOptions},
|
fs::{File, OpenOptions},
|
||||||
os::unix::prelude::FileExt,
|
os::unix::prelude::FileExt,
|
||||||
|
path::Path,
|
||||||
};
|
};
|
||||||
|
|
||||||
use crate::layout::*;
|
use crate::{cursor::Position, layout::*};
|
||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
@ -23,7 +24,7 @@ pub struct Pager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Pager {
|
impl Pager {
|
||||||
pub fn new(file_path: &str) -> Result<Self> {
|
pub fn new<T: AsRef<Path>>(file_path: T) -> Result<Self> {
|
||||||
let file = OpenOptions::new()
|
let file = OpenOptions::new()
|
||||||
.read(true)
|
.read(true)
|
||||||
.write(true)
|
.write(true)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user