Fix more warnings
This commit is contained in:
parent
80666c2cf5
commit
b3d81a8d0a
1 changed files with 2 additions and 12 deletions
14
src/files.rs
14
src/files.rs
|
|
@ -21,8 +21,6 @@ pub mod primitives;
|
||||||
// TODO Move file content from `File` to `LoadedFile`
|
// TODO Move file content from `File` to `LoadedFile`
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct LoadedFile {
|
struct LoadedFile {
|
||||||
/// Canonical path for this file.
|
|
||||||
path: PathBuf,
|
|
||||||
/// User-readable path for this file.
|
/// User-readable path for this file.
|
||||||
name: PathBuf,
|
name: PathBuf,
|
||||||
/// Identifier for codespan-reporting.
|
/// Identifier for codespan-reporting.
|
||||||
|
|
@ -33,9 +31,8 @@ struct LoadedFile {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl LoadedFile {
|
impl LoadedFile {
|
||||||
pub fn new(path: PathBuf, name: PathBuf, cs_id: usize, file: File) -> Self {
|
pub fn new(name: PathBuf, cs_id: usize, file: File) -> Self {
|
||||||
Self {
|
Self {
|
||||||
path,
|
|
||||||
name,
|
name,
|
||||||
cs_id,
|
cs_id,
|
||||||
file,
|
file,
|
||||||
|
|
@ -183,7 +180,7 @@ impl Files {
|
||||||
.cs_files
|
.cs_files
|
||||||
.add(path.to_string_lossy().to_string(), content);
|
.add(path.to_string_lossy().to_string(), content);
|
||||||
self.files
|
self.files
|
||||||
.push(LoadedFile::new(path, name.to_owned(), cs_id, file));
|
.push(LoadedFile::new(name.to_owned(), cs_id, file));
|
||||||
|
|
||||||
for include in includes {
|
for include in includes {
|
||||||
// Since we've successfully opened the file, its name can't be the
|
// Since we've successfully opened the file, its name can't be the
|
||||||
|
|
@ -290,13 +287,6 @@ impl Files {
|
||||||
|
|
||||||
/* Querying */
|
/* Querying */
|
||||||
|
|
||||||
pub fn files(&self) -> Vec<(&Path, &File)> {
|
|
||||||
self.files
|
|
||||||
.iter()
|
|
||||||
.map(|f| (&f.name as &Path, &f.file))
|
|
||||||
.collect()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn commands_of_files(files: &[LoadedFile]) -> Vec<SourcedCommand<'_>> {
|
fn commands_of_files(files: &[LoadedFile]) -> Vec<SourcedCommand<'_>> {
|
||||||
let mut result = vec![];
|
let mut result = vec![];
|
||||||
for (file_index, file) in files.iter().enumerate() {
|
for (file_index, file) in files.iter().enumerate() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue