You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

paste

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

paste - cargo Package Compare versions

Comparing version
1.0.0
to
1.0.1
+1
-1
.cargo_vcs_info.json
{
"git": {
"sha1": "949f5cc56255f400dfa6ffbe2a7d7e4fee7c6d92"
"sha1": "ead8998a76e6b28a0ade8574490e18f7bb52877b"
}
}

@@ -16,6 +16,7 @@ # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO

name = "paste"
version = "1.0.0"
version = "1.0.1"
authors = ["David Tolnay <dtolnay@gmail.com>"]
description = "Macros for all your token pasting needs"
readme = "README.md"
categories = ["no-std"]
license = "MIT OR Apache-2.0"

@@ -22,0 +23,0 @@ repository = "https://github.com/dtolnay/paste"

@@ -202,1 +202,37 @@ use paste::paste;

}
#[rustversion::since(1.46)]
mod test_local_setter {
// https://github.com/dtolnay/paste/issues/7
use paste::paste;
#[derive(Default)]
struct Test {
val: i32,
}
impl Test {
fn set_val(&mut self, arg: i32) {
self.val = arg;
}
}
macro_rules! setter {
($obj:expr, $field:ident, $value:expr) => {
paste! { $obj.[<set_ $field>]($value); }
};
($field:ident, $value:expr) => {{
let mut new = Test::default();
setter!(new, val, $value);
new
}};
}
#[test]
fn test_local_setter() {
let a = setter!(val, 42);
assert_eq!(a.val, 42);
}
}

Sorry, the diff of this file is not supported yet