Skip to content

Commit

Permalink
Stable rust patch
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
  • Loading branch information
SUPERCILEX committed Mar 27, 2023
1 parent beb4bd1 commit e2285aa
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 9 deletions.
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ authors = ["Alex Saveau <saveau.alexandre@gmail.com>"]
edition = "2021"
repository = "https://github.com/SUPERCILEX/fuc"
license = "Apache-2.0"
rust-version = "1.68"

[package]
name = "lint"
Expand Down
2 changes: 2 additions & 0 deletions cpz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ repository.workspace = true
keywords = ["tools", "files", "cp"]
categories = ["command-line-utilities", "development-tools", "filesystem"]
license.workspace = true
rust-version.workspace = true

[dependencies]
clap2 = { version = "4.1.8", features = ["derive", "wrap_help"] }
error-stack = "0.3.1"
fuc_engine = { version = "1", path = "../fuc_engine" }
once_cell = "1.17.1"
thiserror = "1.0.40"

[dev-dependencies]
Expand Down
11 changes: 5 additions & 6 deletions cpz/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
#![feature(once_cell)]
#![feature(let_chains)]

use std::{
borrow::Cow,
cell::LazyCell,
fs,
path::{PathBuf, MAIN_SEPARATOR, MAIN_SEPARATOR_STR},
};
Expand All @@ -12,6 +8,7 @@ use clap::{ArgAction, Parser, ValueHint};
use clap2 as clap;
use error_stack::Report;
use fuc_engine::{CopyOp, Error};
use once_cell::sync::Lazy as LazyCell;

/// A zippy alternative to `cp`, a tool to copy files and directories
#[derive(Parser, Debug)]
Expand Down Expand Up @@ -126,8 +123,10 @@ fn copy(
let to = {
let is_into_directory = *is_into_directory;
let mut to = to;
if is_into_directory && let Some(name) = from.file_name() {
to.push(name);
if is_into_directory {
if let Some(name) = from.file_name() {
to.push(name);
}
}
to
};
Expand Down
2 changes: 2 additions & 0 deletions fuc_engine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ repository.workspace = true
keywords = ["tools", "files"]
categories = ["filesystem"]
license.workspace = true
rust-version.workspace = true

[dependencies]
crossbeam-channel = "0.5.7"
once_cell = "1.17.1"
thiserror = "1.0.40"
typed-builder = "0.14.0"

Expand Down
1 change: 0 additions & 1 deletion fuc_engine/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![feature(once_cell)]
#![allow(clippy::module_name_repetitions)]

use std::{io, path::PathBuf};
Expand Down
4 changes: 2 additions & 2 deletions fuc_engine/src/ops/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,15 @@ mod compat {
// TODO remove: https://github.com/rust-lang/rust/issues/74465#issuecomment-1364969188
#[cfg(target_os = "linux")]
struct LazyCell<T, F = fn() -> T> {
cell: std::cell::OnceCell<T>,
cell: once_cell::sync::OnceCell<T>,
init: std::cell::Cell<Option<F>>,
}

#[cfg(target_os = "linux")]
impl<T, F> LazyCell<T, F> {
pub const fn new(init: F) -> Self {
Self {
cell: std::cell::OnceCell::new(),
cell: once_cell::sync::OnceCell::new(),
init: std::cell::Cell::new(Some(init)),
}
}
Expand Down
1 change: 1 addition & 0 deletions rmz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ repository.workspace = true
keywords = ["tools", "files", "rm"]
categories = ["command-line-utilities", "development-tools", "filesystem"]
license.workspace = true
rust-version.workspace = true

[dependencies]
clap2 = { version = "4.1.8", features = ["derive", "wrap_help"] }
Expand Down

0 comments on commit e2285aa

Please sign in to comment.