melib/utils/xdg: fix doc test compilation

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
This commit is contained in:
Manos Pitsidianakis 2023-09-22 12:26:42 +02:00
parent eb5d49c41a
commit 7888d8b2a5
No known key found for this signature in database
GPG Key ID: 7729C7707F7E09D0
2 changed files with 8 additions and 4 deletions

View File

@ -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`" \

View File

@ -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(
/// <https://cgit.freedesktop.org/xdg/xdg-utils/tree/scripts/xdg-mime.in>
///
/// # 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());