Skip to content

Commit fea273e

Browse files
committed
URLs should not be pathbufs
1 parent cc679ca commit fea273e

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/cmd/shelf.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ fn update_index(
6868
Ok(())
6969
}
7070

71-
fn process_book(path: &str, books_dir: &PathBuf, shelf_url: &PathBuf) -> Result<BookContext> {
71+
fn process_book(path: &str, books_dir: &PathBuf, shelf_url: &str) -> Result<BookContext> {
7272
let book_dir = path.try_resolve()?;
7373
let book_dir = std::fs::canonicalize(book_dir)?;
7474
let mut book = MDBook::load(book_dir)?;
@@ -112,9 +112,8 @@ pub fn execute(_args: &ArgMatches) -> Result<()> {
112112
} else {
113113
"".to_owned()
114114
};
115-
let shelf_url = PathBuf::from(format!(
116-
"{shelf_url_prefix}/{shelf_book_dir}/{shelf_build_dir}/{INDEX_HTML_FILE}"
117-
));
115+
let shelf_url =
116+
format!("{shelf_url_prefix}/{shelf_book_dir}/{shelf_build_dir}/{INDEX_HTML_FILE}");
118117

119118
let mut index_file_name = shelf_book.source_dir();
120119
index_file_name.push(INDEX_MD_FILE);

src/config.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ pub struct BookConfig {
416416
pub text_direction: Option<TextDirection>,
417417
/// Indicates if the book is part of a bookshelf
418418
/// and how to return to the index of the shelf if so
419-
pub shelf_url: Option<PathBuf>,
419+
pub shelf_url: Option<String>,
420420
}
421421

422422
impl Default for BookConfig {

0 commit comments

Comments
 (0)