这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ wrap_comments = true

imports_granularity = "Crate"
group_imports = "StdExternalCrate"

# do not apply 2024 edition formatting
style_edition = "2021"
2 changes: 1 addition & 1 deletion crates/tower-uds/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "tower-uds"
version = "0.1.0"
edition = "2021"
edition = "2024"
license = "MPL-2.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion crates/turbo-trace/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "turbo-trace"
version = "0.1.0"
edition = "2021"
edition = "2024"
license = "MIT"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-analytics/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "turborepo-analytics"
version = "0.1.0"
edition = "2021"
edition = "2024"
license = "MIT"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-api-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "turborepo-api-client"
version = "0.1.0"
edition = "2021"
edition = "2024"
license = "MIT"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-auth/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "turborepo-auth"
version = "0.1.0"
edition = "2021"
edition = "2024"
license = "MIT"

[lints]
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-cache/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "turborepo-cache"
version = "0.1.0"
license = "MIT"
edition = "2021"
edition = "2024"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
Expand Down
4 changes: 2 additions & 2 deletions crates/turborepo-cache/src/signature_authentication.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ mod tests {
}

fn test_signature(test_case: TestCase) -> Result<()> {
env::set_var("TURBO_REMOTE_CACHE_SIGNATURE_KEY", test_case.secret_key);
unsafe { env::set_var("TURBO_REMOTE_CACHE_SIGNATURE_KEY", test_case.secret_key) };
let signature = ArtifactSignatureAuthenticator {
team_id: test_case.team_id.to_vec(),
secret_key_override: None,
Expand All @@ -261,7 +261,7 @@ mod tests {
assert!(!signature.validate(hash, artifact_body, &bad_tag)?);

// Change the key
env::set_var("TURBO_REMOTE_CACHE_SIGNATURE_KEY", "some other key");
unsafe { env::set_var("TURBO_REMOTE_CACHE_SIGNATURE_KEY", "some other key") };

// Confirm that the tag is no longer valid
assert!(!signature.validate_tag(hash, artifact_body, tag.as_ref())?);
Expand Down
12 changes: 6 additions & 6 deletions crates/turborepo-cache/src/upload_progress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ where
// same as `curr_gen_index` but we can't borrow `self` twice
let (curr_gen, index) = {
// usize fits 570 million years of milliseconds since start on 64 bit
let gen = (this.start.elapsed().as_millis() as usize) / INTERVAL;
(gen, gen % BUCKETS)
let r#gen = (this.start.elapsed().as_millis() as usize) / INTERVAL;
(r#gen, r#gen % BUCKETS)
};
let mut state = this.state.lock().unwrap();
let (gen, value) = &mut state.1[index];
if *gen != curr_gen {
*gen = curr_gen;
let (r#gen, value) = &mut state.1[index];
if *r#gen != curr_gen {
*r#gen = curr_gen;
*value = item.len();
} else {
*value += item.len();
Expand Down Expand Up @@ -149,7 +149,7 @@ impl<const BUCKETS: usize, const INTERVAL: usize> UploadProgressQuery<BUCKETS, I
let s = s.lock().unwrap();
let total_bytes =
s.1.iter()
.filter(|(gen, _)| *gen >= min_gen)
.filter(|(r#gen, _)| *r#gen >= min_gen)
.map(|(_, bytes)| *bytes)
.sum::<usize>();

Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-ci/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "turborepo-ci"
version = "0.1.0"
edition = "2021"
edition = "2024"
license = "MIT"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
10 changes: 5 additions & 5 deletions crates/turborepo-ci/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ mod tests {

let live_ci = if Vendor::get_name() == Some("GitHub Actions") {
let live_ci = std::env::var("GITHUB_ACTIONS").unwrap_or_default();
env::remove_var("GITHUB_ACTIONS");
unsafe { env::remove_var("GITHUB_ACTIONS") };
Some(live_ci)
} else {
None
Expand All @@ -187,23 +187,23 @@ mod tests {
let mut env_parts = env.split('=');
let key = env_parts.next().unwrap();
let val = env_parts.next().unwrap_or("some value");
env::set_var(key, val);
unsafe { env::set_var(key, val) };
}

assert_eq!(Vendor::infer_inner(), want.as_ref());

if Vendor::get_name() == Some("GitHub Actions") {
if let Some(live_ci) = live_ci {
env::set_var("GITHUB_ACTIONS", live_ci);
unsafe { env::set_var("GITHUB_ACTIONS", live_ci) };
} else {
env::remove_var("GITHUB_ACTIONS");
unsafe { env::remove_var("GITHUB_ACTIONS") };
}
}

for env in set_env {
let mut env_parts = env.split('=');
let key = env_parts.next().unwrap();
env::remove_var(key);
unsafe { env::remove_var(key) };
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-dirs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "turborepo-dirs"
version = "0.1.0"
edition = "2021"
edition = "2024"
license = "MIT"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-env/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "turborepo-env"
version = "0.1.0"
edition = "2021"
edition = "2024"
license = "MIT"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-errors/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "turborepo-errors"
version = "0.1.0"
edition = "2021"
edition = "2024"
license = "MIT"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-fixed-map/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "turborepo-fixed-map"
version = "0.1.0"
edition = "2021"
edition = "2024"
license = "MIT"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-fs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "turborepo-fs"
version = "0.1.0"
license = "MIT"
edition = "2021"
edition = "2024"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-globwalk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "globwalk"
version = "0.1.0"
edition = "2021"
edition = "2024"
license = "MIT"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-globwatch/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "globwatch"
version = "0.1.0"
edition = "2021"
edition = "2024"
description = "Watch a set of globs efficiently"
license = "MIT OR Apache-2.0"

Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-graph-utils/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "turborepo-graph-utils"
version = "0.1.0"
edition = "2021"
edition = "2024"
license = "MIT"

[lints]
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-lockfiles/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "turborepo-lockfiles"
version = "0.1.0"
edition = "2021"
edition = "2024"
license = "MIT"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-lsp/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "turborepo-lsp"
version = "0.1.0"
edition = "2021"
edition = "2024"
license = "MIT"

[features]
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-microfrontends/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "turborepo-microfrontends"
version = "0.1.0"
edition = "2021"
edition = "2024"
license = "MIT"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-paths/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "turbopath"
version = "0.1.0"
license = "MIT"
edition = "2021"
edition = "2024"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-pidlock/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "pidlock"
version = "0.1.4"
authors = ["Paul Hummer <paul@eventuallyanyway.com>"]
license = "MIT"
edition = "2021"
edition = "2024"
description = "A library for using pidfiles as resource locks"
repository = "https://github.com/rockstar/pidlock"
keywords = ["pidfile", "file", "filelock", "server", "lock"]
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-pidlock/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ mod tests {
.open(path.clone())
.expect("Could not open file for writing");

file.write_all(&format!("{}", thread_rng().gen::<i32>()).into_bytes()[..])
file.write_all(&format!("{}", thread_rng().r#gen::<i32>()).into_bytes()[..])
.unwrap();

drop(file);
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-repository/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "turborepo-repository"
version = "0.1.0"
edition = "2021"
edition = "2024"
license = "MIT"

[lints]
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-repository/src/package_manager/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ impl PackageManager {
pub fn get_package_jsons(
&self,
repo_root: &AbsoluteSystemPath,
) -> Result<impl Iterator<Item = AbsoluteSystemPathBuf>, Error> {
) -> Result<impl Iterator<Item = AbsoluteSystemPathBuf> + use<>, Error> {
let globs = self.get_workspace_globs(repo_root)?;
Ok(globs.get_package_jsons(repo_root)?)
}
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-repository/src/workspaces.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ impl WorkspaceGlobs {
pub fn get_package_jsons(
&self,
repo_root: &AbsoluteSystemPath,
) -> Result<impl Iterator<Item = AbsoluteSystemPathBuf>, Error> {
) -> Result<impl Iterator<Item = AbsoluteSystemPathBuf> + use<>, Error> {
let files = globwalk::globwalk(
repo_root,
&self.package_json_inclusions,
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-scm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "turborepo-scm"
version = "0.1.0"
edition = "2021"
edition = "2024"
license = "MIT"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-signals/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "turborepo-signals"
version = "0.1.0"
edition = "2021"
edition = "2024"
license = "MIT"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-telemetry/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "turborepo-telemetry"
version = "0.1.0"
edition = "2021"
edition = "2024"
license = "MIT"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-ui/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "turborepo-ui"
version = "0.1.0"
edition = "2021"
edition = "2024"
license = "MIT"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-unescape/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "turborepo-unescape"
version = "0.1.0"
edition = "2021"
edition = "2024"
license = "MPL-2.0"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-updater/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "turbo-updater"
version = "0.1.0"
edition = "2021"
edition = "2024"
description = "Minimal wrapper around update-informer to provide npm registry support and consistent UI"
license = "MIT"
publish = false
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-vercel-api-mock/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "turborepo-vercel-api-mock"
version = "0.1.0"
edition = "2021"
edition = "2024"
license = "MIT"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-vercel-api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "turborepo-vercel-api"
version = "0.1.0"
edition = "2021"
edition = "2024"
license = "MIT"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-vt100/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "turborepo-vt100"
version = "0.15.2"
authors = ["Jesse Luehrs <doy@tozt.net>"]
edition = "2021"
edition = "2024"

description = "Library for parsing terminal data"
homepage = "https://github.com/doy/vt100-rust"
Expand Down
6 changes: 1 addition & 5 deletions crates/turborepo-vt100/src/perform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,7 @@ impl vte::Perform for WrappedScreen {

fn canonicalize_params_1(params: &vte::Params, default: u16) -> u16 {
let first = params.iter().next().map_or(0, |x| *x.first().unwrap_or(&0));
if first == 0 {
default
} else {
first
}
if first == 0 { default } else { first }
}

fn canonicalize_params_2(
Expand Down
Loading
Loading