Skip to content

Commit

Permalink
Renamed master -> main
Browse files Browse the repository at this point in the history
  • Loading branch information
cuviper committed Feb 10, 2024
1 parent 51879dd commit aff238f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/master.yaml → .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: master
name: main
on:
push:
branches:
- master
- main
schedule:
- cron: '0 0 * * 0' # 00:00 Sunday

Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ exclude = ["bors.toml", ".github/*"]
proc-macro = true

[dependencies]
proc-macro-crate = "0.1"
proc-macro-crate = "1.2.1"
proc-macro2 = "1"
quote = "1"
syn = { version = "1", features = ["fold", "full"] }
syn = { version = "2", features = ["fold", "full"] }

[dev-dependencies]
rayon = "1.3"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![rayon-macro crate](https://img.shields.io/crates/v/rayon-macro.svg)](https://crates.io/crates/rayon-macro)
[![rayon-macro documentation](https://docs.rs/rayon-macro/badge.svg)](https://docs.rs/rayon-macro)
![minimum rustc 1.45](https://img.shields.io/badge/rustc-1.45+-red.svg)
![build status](https://github.com/rayon-rs/rayon-macro/workflows/master/badge.svg)
![build status](https://github.com/rayon-rs/rayon-macro/workflows/main/badge.svg)

The `rayon-macro` crate provides procedural macros to make it easier to
transform serial code into `rayon`-enabled parallel code. For example,
Expand Down
7 changes: 5 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use proc_macro::TokenStream;
use proc_macro2::{Ident, Span};
use proc_macro_crate::crate_name;
use proc_macro_crate::{crate_name, FoundCrate};
use quote::quote;
use syn::fold::{self, Fold};
use syn::parse_macro_input;
Expand Down Expand Up @@ -34,7 +34,10 @@ pub fn parallel(input: TokenStream) -> TokenStream {
let body = transform.fold_block(body);

let rayon_crate = crate_name("rayon").expect("rayon is present in `Cargo.toml`");
let rayon = Ident::new(&rayon_crate, Span::call_site());
let rayon = match rayon_crate {
FoundCrate::Name(name) => Ident::new(&name, Span::call_site()),
FoundCrate::Itself => panic!("expected a crate name"),
};

TokenStream::from(quote! {
::#rayon::iter::ParallelIterator::for_each(
Expand Down

0 comments on commit aff238f

Please sign in to comment.