fix some clippy warnings in platforms

This commit is contained in:
Folkert 2023-03-06 21:18:30 +01:00
parent 86671d659c
commit 8546f2c52b
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
3 changed files with 11 additions and 5 deletions

View file

@ -9,10 +9,9 @@ use core::mem::MaybeUninit;
use glue::Metadata;
use roc_std::{RocDict, RocList, RocResult, RocStr};
use std::borrow::{Borrow, Cow};
use std::ffi::{CStr, OsStr};
use std::ffi::{ OsStr};
use std::fs::File;
use std::io::Write;
use std::os::raw::c_char;
use std::path::Path;
use std::time::Duration;

View file

@ -1,3 +1,5 @@
#![allow(unused)]
mod graphics;
mod gui;
mod roc;

View file

@ -283,11 +283,16 @@ fn find_files(dir: &Path, file_paths: &mut Vec<PathBuf>) -> std::io::Result<()>
/// and there seems to be no good way to strip it. So we resort to some string manipulation.
pub fn strip_windows_prefix(path_buf: PathBuf) -> std::path::PathBuf {
#[cfg(not(windows))]
return path_buf;
{
path_buf
}
let path_str = path_buf.display().to_string();
#[cfg(windows)]
{
let path_str = path_buf.display().to_string();
std::path::Path::new(path_str.trim_start_matches(r"\\?\")).to_path_buf()
std::path::Path::new(path_str.trim_start_matches(r"\\?\")).to_path_buf()
}
}
fn is_roc_code_block(cbk: &pulldown_cmark::CodeBlockKind) -> bool {