mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-12 19:55:14 +02:00
[pitboss/grind] deferred session-0009 (20260520T233019Z-6958)
This commit is contained in:
parent
a6f34554db
commit
38cc0ce05f
60 changed files with 509 additions and 541 deletions
|
|
@ -114,11 +114,10 @@ impl Lang {
|
|||
/// Used by [`crate::dynamic::spec`] so spec derivation no longer rejects
|
||||
/// CLI entry points and other extensionless / non-canonical files.
|
||||
pub fn from_path_or_content(path: &Path, head_bytes: &[u8]) -> Option<Lang> {
|
||||
if let Some(ext) = path.extension().and_then(|e| e.to_str()) {
|
||||
if let Some(lang) = Self::from_extension(ext) {
|
||||
if let Some(ext) = path.extension().and_then(|e| e.to_str())
|
||||
&& let Some(lang) = Self::from_extension(ext) {
|
||||
return Some(lang);
|
||||
}
|
||||
}
|
||||
if let Some(lang) = lang_from_shebang(head_bytes) {
|
||||
return Some(lang);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue