forked from lavina/lavina
				
			Compare commits
	
		
			6 Commits
		
	
	
		
			f85c3bb6ce
			...
			ce682a842f
		
	
	| Author | SHA1 | Date | 
|---|---|---|
|  | ce682a842f | |
|  | b7d695519e | |
|  | ed83436501 | |
|  | 550c8b74b2 | |
|  | 85fa607e16 | |
|  | 4dbc68adfe | 
|  | @ -1,3 +1,4 @@ | ||||||
| /target | /target | ||||||
| /db.sqlite | /db.sqlite | ||||||
| .idea/ | .idea/ | ||||||
|  | .DS_Store | ||||||
|  |  | ||||||
|  | @ -1,4 +1,4 @@ | ||||||
| #![feature(generators, generator_trait, type_alias_impl_trait, impl_trait_in_assoc_type)] | #![feature(coroutines, coroutine_trait, type_alias_impl_trait, impl_trait_in_assoc_type)] | ||||||
| 
 | 
 | ||||||
| mod proto; | mod proto; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,6 +1,6 @@ | ||||||
| #![feature(
 | #![feature(
 | ||||||
|     generators, |     coroutines, | ||||||
|     generator_trait, |     coroutine_trait, | ||||||
|     type_alias_impl_trait, |     type_alias_impl_trait, | ||||||
|     impl_trait_in_assoc_type |     impl_trait_in_assoc_type | ||||||
| )] | )] | ||||||
|  |  | ||||||
|  | @ -1,4 +1,4 @@ | ||||||
| use std::ops::Generator; | use std::ops::Coroutine; | ||||||
| use std::pin::Pin; | use std::pin::Pin; | ||||||
| 
 | 
 | ||||||
| use quick_xml::NsReader; | use quick_xml::NsReader; | ||||||
|  | @ -37,7 +37,7 @@ pub trait Parser: Sized { | ||||||
| 
 | 
 | ||||||
| impl<T, Out> Parser for T | impl<T, Out> Parser for T | ||||||
| where | where | ||||||
|     T: Generator<(ResolveResult<'static>, &'static Event<'static>), Yield = (), Return = Out> |     T: Coroutine<(ResolveResult<'static>, &'static Event<'static>), Yield = (), Return = Out> | ||||||
|         + Unpin, |         + Unpin, | ||||||
| { | { | ||||||
|     type Output = Out; |     type Output = Out; | ||||||
|  | @ -48,13 +48,13 @@ where | ||||||
|         event: &Event<'a>, |         event: &Event<'a>, | ||||||
|     ) -> Continuation<Self, Self::Output> { |     ) -> Continuation<Self, Self::Output> { | ||||||
|         let s = Pin::new(&mut self); |         let s = Pin::new(&mut self); | ||||||
|         // this is a very rude workaround fixing the fact that rust generators
 |         // this is a very rude workaround fixing the fact that rust coroutines
 | ||||||
|         // 1. don't support higher-kinded lifetimes (i.e. no `impl for <'a> Generator<Event<'a>>)
 |         // 1. don't support higher-kinded lifetimes (i.e. no `impl for <'a> Coroutine<Event<'a>>)
 | ||||||
|         // 2. don't track borrows across yield points and lack thereof
 |         // 2. don't track borrows across yield points and lack thereof
 | ||||||
|         // implementors of Parser should manually check that inputs are not used across yields
 |         // implementors of Parser should manually check that inputs are not used across yields
 | ||||||
|         match s.resume(unsafe { std::mem::transmute((namespace, event)) }) { |         match s.resume(unsafe { std::mem::transmute((namespace, event)) }) { | ||||||
|             std::ops::GeneratorState::Yielded(()) => Continuation::Continue(self), |             std::ops::CoroutineState::Yielded(()) => Continuation::Continue(self), | ||||||
|             std::ops::GeneratorState::Complete(res) => Continuation::Final(res), |             std::ops::CoroutineState::Complete(res) => Continuation::Final(res), | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -1 +1 @@ | ||||||
| nightly-2023-10-06 | nightly-2023-12-07 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue