Skip to content

Commit

Permalink
update to rust 1.80.1 (#655)
Browse files Browse the repository at this point in the history
- update to rust 1.80.1 & fix lint (#655)
- int tests were pretty broken; more broken on 1.80
  • Loading branch information
ahl authored Aug 17, 2024
1 parent 96f03dd commit 4070232
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.76"
channel = "1.80.1"
profile = "default"
14 changes: 4 additions & 10 deletions typify-impl/src/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2003,7 +2003,7 @@ mod tests {
};

#[track_caller]
fn int_helper<T: JsonSchema>() {
fn int_helper<T: JsonSchema>(type_name: &'static str) {
let schema = schema_for!(T);

let mut type_space = TypeSpace::default();
Expand All @@ -2018,14 +2018,8 @@ mod tests {
)
.unwrap();
let output = ty.type_name(&type_space);
let actual = output
.rsplit_once("::")
.map(|(_, x)| x.trim())
.unwrap_or(&output);
let expected = std::any::type_name::<T>()
.rsplit_once("::")
.map(|(_, x)| x.trim())
.unwrap_or(&output);
let actual = output.split("::").last().unwrap().trim();
let expected = type_name.split("::").last().unwrap();
assert_eq!(actual, expected);
}

Expand All @@ -2034,7 +2028,7 @@ mod tests {
paste! {
#[test]
fn [<test_int_ $t:lower>]() {
int_helper::<$t>()
int_helper::<$t>(stringify!($t))
}
}
};
Expand Down
1 change: 1 addition & 0 deletions typify-impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1314,6 +1314,7 @@ mod tests {

#[test]
fn test_alias() {
#[allow(dead_code)]
#[derive(JsonSchema, Schema)]
struct Stuff(Vec<String>);

Expand Down
4 changes: 2 additions & 2 deletions typify-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ struct WithSet {
set: HashSet<TestStruct>,
}

struct LoginName(String);
struct LoginName;
impl JsonSchema for LoginName {
fn schema_name() -> String {
"LoginName".to_string()
Expand All @@ -72,7 +72,7 @@ impl JsonSchema for LoginName {
}
}

struct Pancakes(String);
struct Pancakes;
impl JsonSchema for Pancakes {
fn schema_name() -> String {
"Pancakes".to_string()
Expand Down

0 comments on commit 4070232

Please sign in to comment.