Skip to content

Commit 55b2161

Browse files
authored
Fix clippy warnings (#188)
1 parent 358ab77 commit 55b2161

File tree

4 files changed

+5
-10
lines changed

4 files changed

+5
-10
lines changed

bevy_editor_panes/bevy_asset_browser/src/io/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub fn create_new_folder(mut parent: PathBuf) -> std::io::Result<String> {
1919
create_dir_all(&parent)?;
2020
Ok(parent
2121
.components()
22-
.last()
22+
.next_back()
2323
.unwrap()
2424
.as_os_str()
2525
.to_str()
@@ -44,7 +44,7 @@ pub fn create_new_script(mut parent: PathBuf) -> std::io::Result<String> {
4444
)?;
4545
Ok(parent
4646
.components()
47-
.last()
47+
.next_back()
4848
.unwrap()
4949
.as_os_str()
5050
.to_str()

bevy_editor_panes/bevy_asset_browser/src/io/task.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ pub fn fetch_directory_content(
5959
while let Some(entry) = dir_stream.next().await {
6060
let entry_name = entry
6161
.components()
62-
.last()
62+
.next_back()
6363
.unwrap()
6464
.as_os_str()
6565
.to_string_lossy()

crates/bevy_editor/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//!
99
//! - Initially, this will be a standard Bevy application that simply edits scenes with `DefaultPlugins`.
1010
//! - Then, it will be a statically linked plugin that can be added to any Bevy game at compile time,
11-
//! which transforms the user's application into an editor that runs their game.
11+
//! which transforms the user's application into an editor that runs their game.
1212
//! - Finally, it will be a standalone application that communicates with a running Bevy game via the Bevy Remote Protocol.
1313
1414
use bevy::app::App as BevyApp;

crates/bevy_editor/src/project/mod.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,7 @@ pub fn run_project(project: &ProjectInfo) -> std::io::Result<()> {
122122
.current_dir(&project.path)
123123
.args(["/C", "cargo", "run"])
124124
.spawn()
125-
.map_err(|error| {
126-
std::io::Error::new(
127-
std::io::ErrorKind::Other,
128-
format!("Failed to run project: {}", error),
129-
)
130-
})?;
125+
.map_err(|error| std::io::Error::other(format!("Failed to run project: {}", error)))?;
131126

132127
#[cfg(not(target_os = "windows"))]
133128
std::process::Command::new("sh")

0 commit comments

Comments
 (0)