From 7888d8b2a5dc977f0f18094a32dc73893a5cfc4f Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Fri, 22 Sep 2023 12:26:42 +0200 Subject: [PATCH] melib/utils/xdg: fix doc test compilation Signed-off-by: Manos Pitsidianakis --- Makefile | 6 +++++- melib/src/utils/xdg/mod.rs | 6 +++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 7305d794..23a61b53 100644 --- a/Makefile +++ b/Makefile @@ -109,9 +109,13 @@ lint: @RUSTFLAGS='${RUSTFLAGS}' $(CARGO_BIN) clippy --no-deps --all-features --all --tests --examples --benches --bins .PHONY: test -test: +test: test-docs @RUSTFLAGS='${RUSTFLAGS}' ${CARGO_BIN} test ${CARGO_ARGS} ${CARGO_COLOR}--target-dir="${CARGO_TARGET_DIR}" --all --tests --examples --benches --bins +.PHONY: test-docs +test-docs: + @RUSTFLAGS='${RUSTFLAGS}' ${CARGO_BIN} test ${CARGO_ARGS} ${CARGO_COLOR}--target-dir="${CARGO_TARGET_DIR}" --all --doc + .PHONY: check-deps check-deps: @(if ! echo ${MIN_RUSTC}\\n`${CARGO_BIN} --version | grep ^cargo | cut -d ' ' -f 2` | sort -CV; then echo "rust version >= ${RED}${MIN_RUSTC}${ANSI_RESET} required, found: `which ${CARGO_BIN}` `${CARGO_BIN} --version | cut -d ' ' -f 2`" \ diff --git a/melib/src/utils/xdg/mod.rs b/melib/src/utils/xdg/mod.rs index 8f4b7ec5..2d236e4d 100644 --- a/melib/src/utils/xdg/mod.rs +++ b/melib/src/utils/xdg/mod.rs @@ -119,7 +119,7 @@ impl Ini { /// /// # Example /// ```no_run -/// use xdg_utils::query_default_app; +/// use melib::utils::xdg::query_default_app; /// /// // The crate author recommends firefox. /// assert_eq!( @@ -330,8 +330,8 @@ pub fn desktop_file_to_command( /// /// /// # Example -/// ``` -/// use xdg_utils::query_mime_info; +/// ```no_run +/// use melib::utils::xdg::query_mime_info; /// let result = query_mime_info("/bin/sh") /// .map_err(|_| ()) /// .map(|bytes| String::from_utf8_lossy(&bytes).into_owned());