mirror of
https://github.com/google/flatbuffers.git
synced 2026-11-08 05:09:09 +00:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3f4f0497ea |
@@ -75,17 +75,6 @@ extension Array where Element == Package.Dependency {
|
||||
.package(
|
||||
url: "https://github.com/grpc/grpc-swift-nio-transport.git",
|
||||
from: "2.0.0"),
|
||||
// swift-crypto arrives through grpc-swift-nio-transport -> swift-nio-ssl
|
||||
// and is otherwise resolved afresh on every build, because this package
|
||||
// ships no Package.resolved. 5.x asks for swift-tools-version 6.2, so only
|
||||
// the 6.2 CI job selects it - and then fails to compile it, because 5.x
|
||||
// uses `@nonexhaustive`, which the 6.2.x toolchains do not accept yet.
|
||||
// Stay on the last 4.x release that still builds with every toolchain in
|
||||
// the Swift CI matrix (4.3.0 declares swift-tools-version 6.0; 4.4+ asks
|
||||
// for 6.1 and would drop the 6.0 job).
|
||||
.package(
|
||||
url: "https://github.com/apple/swift-crypto.git",
|
||||
"4.0.0" ..< "4.4.0"),
|
||||
]
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -83,11 +83,6 @@ macro_rules! impl_push_for_endian_scalar {
|
||||
unsafe fn push(&self, dst: &mut [u8], _written_len: usize) {
|
||||
emplace_scalar::<$ty>(dst, *self);
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn alignment() -> PushAlignment {
|
||||
PushAlignment::new(size_of::<$ty>())
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -103,23 +98,3 @@ impl_push_for_endian_scalar!(u64);
|
||||
impl_push_for_endian_scalar!(i64);
|
||||
impl_push_for_endian_scalar!(f32);
|
||||
impl_push_for_endian_scalar!(f64);
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn endian_scalar_push_alignment_matches_wire_size() {
|
||||
assert_eq!(<bool as Push>::alignment().value(), 1);
|
||||
assert_eq!(<u8 as Push>::alignment().value(), 1);
|
||||
assert_eq!(<i8 as Push>::alignment().value(), 1);
|
||||
assert_eq!(<u16 as Push>::alignment().value(), 2);
|
||||
assert_eq!(<i16 as Push>::alignment().value(), 2);
|
||||
assert_eq!(<u32 as Push>::alignment().value(), 4);
|
||||
assert_eq!(<i32 as Push>::alignment().value(), 4);
|
||||
assert_eq!(<f32 as Push>::alignment().value(), 4);
|
||||
assert_eq!(<u64 as Push>::alignment().value(), 8);
|
||||
assert_eq!(<i64 as Push>::alignment().value(), 8);
|
||||
assert_eq!(<f64 as Push>::alignment().value(), 8);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user