mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 15:32:46 +00:00 
			
		
		
		
	Kernel: Remove the KString::try_create(String::formatted(...)) pattern
We can now directly create formatted KStrings with KString::formatted. :^)
This commit is contained in:
		
							parent
							
								
									7d6058415e
								
							
						
					
					
						commit
						52beeebe70
					
				
					 11 changed files with 18 additions and 35 deletions
				
			
		|  | @ -18,11 +18,9 @@ NonnullRefPtr<ATAPIDiscDevice> ATAPIDiscDevice::create(const ATAController& cont | |||
| { | ||||
|     auto minor_device_number = StorageManagement::generate_storage_minor_number(); | ||||
| 
 | ||||
|     // FIXME: We need a way of formatting strings with KString.
 | ||||
|     auto device_name = String::formatted("hd{:c}", 'a' + minor_device_number.value()); | ||||
|     auto device_name_kstring = KString::must_create(device_name.view()); | ||||
|     auto device_name = MUST(KString::formatted("hd{:c}", 'a' + minor_device_number.value())); | ||||
| 
 | ||||
|     auto disc_device_or_error = DeviceManagement::try_create_device<ATAPIDiscDevice>(controller, ata_address, minor_device_number.value(), capabilities, max_addressable_block, move(device_name_kstring)); | ||||
|     auto disc_device_or_error = DeviceManagement::try_create_device<ATAPIDiscDevice>(controller, ata_address, minor_device_number.value(), capabilities, max_addressable_block, move(device_name)); | ||||
|     // FIXME: Find a way to propagate errors
 | ||||
|     VERIFY(!disc_device_or_error.is_error()); | ||||
|     return disc_device_or_error.release_value(); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Daniel Bertalan
						Daniel Bertalan