mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-22 21:55:15 +00:00
More consistent handling of non-Unicode file names (should be rare)
This commit is contained in:
@@ -9,7 +9,10 @@ use crate::{
|
||||
snapshot::InstanceSnapshot,
|
||||
};
|
||||
|
||||
use super::middleware::{SnapshotFileResult, SnapshotInstanceResult, SnapshotMiddleware};
|
||||
use super::{
|
||||
error::SnapshotError,
|
||||
middleware::{SnapshotFileResult, SnapshotInstanceResult, SnapshotMiddleware},
|
||||
};
|
||||
|
||||
pub struct SnapshotJsonModel;
|
||||
|
||||
@@ -22,7 +25,12 @@ impl SnapshotMiddleware for SnapshotJsonModel {
|
||||
return Ok(None);
|
||||
}
|
||||
|
||||
let file_name = entry.path().file_name().unwrap().to_string_lossy();
|
||||
let file_name = entry
|
||||
.path()
|
||||
.file_name()
|
||||
.unwrap()
|
||||
.to_str()
|
||||
.ok_or_else(|| SnapshotError::file_name_bad_unicode(entry.path()))?;
|
||||
|
||||
let instance_name = match match_trailing(&file_name, ".model.json") {
|
||||
Some(name) => name.to_owned(),
|
||||
|
||||
Reference in New Issue
Block a user