git-gamble 2.12.1

blend TDD + TCR to make sure to develop the right thing 😌, baby step by baby step πŸ‘ΆπŸ¦Ά
Documentation
#[cfg(unix)]
use std::os::unix::fs::MetadataExt;
use std::path::Path;

pub(crate) trait IsExecutablePath {
	fn is_executable(&self) -> bool;
}

impl IsExecutablePath for Path {
	#[cfg(unix)]
	fn is_executable(&self) -> bool {
		self.metadata().unwrap().mode() & 0o111 != 0 // TODO remove unwrap and test the bad case scenario
	}

	#[cfg(not(unix))]
	fn is_executable(&self) -> bool {
		true
	}
}