Skip to content

Commit

Permalink
Merge pull request #1596 from RossSmyth/WinLints
Browse files Browse the repository at this point in the history
Fix up some lints on Windows
  • Loading branch information
tmccombs authored Aug 8, 2024
2 parents 8958a7b + 80a73fd commit e9fe337
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ pub struct Config {
pub ls_colors: Option<LsColors>,

/// Whether or not we are writing to an interactive terminal
#[cfg_attr(not(unix), allow(unused))]
pub interactive_terminal: bool,

/// The type of file to search for. If set to `None`, all file types are displayed. If
Expand Down
8 changes: 4 additions & 4 deletions src/hyperlink.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
use crate::filesystem::absolute_path;
use std::fmt::{self, Formatter, Write};
use std::path::{Path, PathBuf};
use std::sync::OnceLock;

pub(crate) struct PathUrl(PathBuf);

#[cfg(unix)]
static HOSTNAME: OnceLock<String> = OnceLock::new();

impl PathUrl {
pub(crate) fn new(path: &Path) -> Option<PathUrl> {
Some(PathUrl(absolute_path(path).ok()?))
Expand Down Expand Up @@ -46,6 +42,10 @@ fn encode(f: &mut Formatter, byte: u8) -> fmt::Result {

#[cfg(unix)]
fn host() -> &'static str {
use std::sync::OnceLock;

static HOSTNAME: OnceLock<String> = OnceLock::new();

HOSTNAME
.get_or_init(|| {
nix::unistd::gethostname()
Expand Down

0 comments on commit e9fe337

Please sign in to comment.