generic_format_parser = { path = "generic_format_parser" }
[lib]
-crate_type = ["staticlib", "rlib"]
+crate-type = ["staticlib", "rlib"]
[[bin]]
name = "format_parser_test"
unicode_xid::UnicodeXID::is_xid_continue(c)
}
-// Workaround for Ubuntu 18.04. The default Rust package is 1.65 (and unlikely to change I assume?), but the
-// generic format parser library uses `is_some_and` which was introduced in 1.70. So this is a reimplementation,
-// directly taken from the standard library sources
-trait IsSomeAnd<T> {
- fn is_some_and(self, f: impl FnOnce(T) -> bool) -> bool;
-}
-
-impl<T> IsSomeAnd<T> for Option<T> {
- fn is_some_and(self, f: impl FnOnce(T) -> bool) -> bool {
- match self {
- None => false,
- Some(x) => f(x),
- }
- }
-}
-
// use rustc_lexer::unescape;
pub use Alignment::*;
pub use Count::*;
use std::ffi::CStr;
-trait StringLeakExt {
- fn leak<'a>(self) -> &'a mut str;
-}
-
-impl StringLeakExt for String {
- fn leak<'a>(self) -> &'a mut str {
- Box::leak(self.into_boxed_str())
- }
-}
-
trait IntoFFI<T> {
fn into_ffi(self) -> T;
}
// InlineAsm,
// }
- #[derive(Copy, Clone)]
- #[repr(C)]
- struct InnerOffset(usize);
-
/// A piece is a portion of the format string which represents the next part
/// to emit. These are emitted as a stream by the `Parser` class.
#[derive(Debug, Clone, PartialEq)]