frontend-utils: Drop 'static bound from push_key
This commit is contained in:
parent
4df57bb122
commit
c95d02339e
|
@ -64,8 +64,8 @@ pub fn read_preferences(input: &str) -> ParseDetails<SavedGlobalPreferences> {
|
||||||
});
|
});
|
||||||
|
|
||||||
ParseDetails {
|
ParseDetails {
|
||||||
result: DocumentHolder::new(result, document),
|
|
||||||
warnings: cx.warnings,
|
warnings: cx.warnings,
|
||||||
|
result: DocumentHolder::new(result, document),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,8 +35,8 @@ pub fn read_bookmarks(input: &str) -> ParseDetails<Bookmarks> {
|
||||||
});
|
});
|
||||||
|
|
||||||
ParseDetails {
|
ParseDetails {
|
||||||
result: DocumentHolder::new(result, document),
|
|
||||||
warnings: cx.warnings,
|
warnings: cx.warnings,
|
||||||
|
result: DocumentHolder::new(result, document),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,8 +46,8 @@ impl BundleInformation {
|
||||||
.unwrap_or(Err(BundleInformationParseError::InvalidBundleSection))?;
|
.unwrap_or(Err(BundleInformationParseError::InvalidBundleSection))?;
|
||||||
|
|
||||||
Ok(ParseDetails {
|
Ok(ParseDetails {
|
||||||
result: DocumentHolder::new(result, document),
|
|
||||||
warnings: cx.warnings,
|
warnings: cx.warnings,
|
||||||
|
result: DocumentHolder::new(result, document),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,14 +124,14 @@ impl fmt::Display for ParseWarning {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
pub struct ParseContext {
|
pub struct ParseContext<'a> {
|
||||||
pub warnings: Vec<ParseWarning>,
|
pub warnings: Vec<ParseWarning>,
|
||||||
/// Path of the current item being parsed
|
/// Path of the current item being parsed
|
||||||
path: Vec<&'static str>,
|
path: Vec<&'a str>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ParseContext {
|
impl<'a> ParseContext<'a> {
|
||||||
pub fn push_key(&mut self, key: &'static str) {
|
pub fn push_key(&mut self, key: &'a str) {
|
||||||
self.path.push(key);
|
self.path.push(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,9 +166,9 @@ pub trait ReadExt<'a> {
|
||||||
|
|
||||||
fn get_table_like<R>(
|
fn get_table_like<R>(
|
||||||
&'a self,
|
&'a self,
|
||||||
cx: &mut ParseContext,
|
cx: &mut ParseContext<'a>,
|
||||||
key: &'static str,
|
key: &'static str,
|
||||||
fun: impl FnOnce(&mut ParseContext, &dyn TableLike) -> R,
|
fun: impl FnOnce(&mut ParseContext<'a>, &'a dyn TableLike) -> R,
|
||||||
) -> Option<R> {
|
) -> Option<R> {
|
||||||
let mut result = None;
|
let mut result = None;
|
||||||
if let Some(item) = self.get_impl(key) {
|
if let Some(item) = self.get_impl(key) {
|
||||||
|
@ -187,9 +187,9 @@ pub trait ReadExt<'a> {
|
||||||
|
|
||||||
fn get_array_of_tables<R>(
|
fn get_array_of_tables<R>(
|
||||||
&'a self,
|
&'a self,
|
||||||
cx: &mut ParseContext,
|
cx: &mut ParseContext<'a>,
|
||||||
key: &'static str,
|
key: &'static str,
|
||||||
fun: impl FnOnce(&mut ParseContext, &ArrayOfTables) -> R,
|
fun: impl FnOnce(&mut ParseContext<'a>, &'a ArrayOfTables) -> R,
|
||||||
) -> Option<R> {
|
) -> Option<R> {
|
||||||
let mut result = None;
|
let mut result = None;
|
||||||
if let Some(item) = self.get_impl(key) {
|
if let Some(item) = self.get_impl(key) {
|
||||||
|
|
Loading…
Reference in New Issue