forked from mirrors/gecko-dev
		
	 8182bee632
			
		
	
	
		8182bee632
		
	
	
	
	
		
			
			Upgrades to Glean v50.0.1, which comes with a rewritten core and UniFFI-powered bindings. Glean has some API changes, so we swap it over to that. Mostly mechanical changes. Also upgrades to inherent v1.0 in fog. This matches what Glean uses internally and gets rid of one duplicated crate. Also upgrades to glean-parser==6.0.1 One crate duplication now (change in `python/mozbuild/mozbuild/vendor/vendor_rust.py` required). Some new crates now vendored. These are transitive dependencies of Glean dependencies, all with valid licenses and already used in other products (mobile). Differential Revision: https://phabricator.services.mozilla.com/D146062
		
			
				
	
	
		
			32 lines
		
	
	
	
		
			948 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			32 lines
		
	
	
	
		
			948 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| use minimal_lexical::bigint;
 | |
| #[cfg(feature = "alloc")]
 | |
| pub use minimal_lexical::heapvec::HeapVec as VecType;
 | |
| #[cfg(not(feature = "alloc"))]
 | |
| pub use minimal_lexical::stackvec::StackVec as VecType;
 | |
| 
 | |
| pub fn vec_from_u32(x: &[u32]) -> VecType {
 | |
|     let mut vec = VecType::new();
 | |
|     #[cfg(not(all(target_pointer_width = "64", not(target_arch = "sparc"))))]
 | |
|     {
 | |
|         for &xi in x {
 | |
|             vec.try_push(xi as bigint::Limb).unwrap();
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     #[cfg(all(target_pointer_width = "64", not(target_arch = "sparc")))]
 | |
|     {
 | |
|         for xi in x.chunks(2) {
 | |
|             match xi.len() {
 | |
|                 1 => vec.try_push(xi[0] as bigint::Limb).unwrap(),
 | |
|                 2 => {
 | |
|                     let xi0 = xi[0] as bigint::Limb;
 | |
|                     let xi1 = xi[1] as bigint::Limb;
 | |
|                     vec.try_push((xi1 << 32) | xi0).unwrap()
 | |
|                 },
 | |
|                 _ => unreachable!(),
 | |
|             }
 | |
|         }
 | |
|     }
 | |
| 
 | |
|     vec
 | |
| }
 |