mirror of
				https://github.com/astral-sh/ruff.git
				synced 2025-11-03 21:24:29 +00:00 
			
		
		
		
	Update Rust toolchain to 1.89 (#19807)
This commit is contained in:
		
							parent
							
								
									b22586fa0e
								
							
						
					
					
						commit
						7dfde3b929
					
				
					 101 changed files with 234 additions and 200 deletions
				
			
		| 
						 | 
				
			
			@ -33,7 +33,7 @@ use super::{Result, schedule::BackgroundSchedule};
 | 
			
		|||
/// that is of type [`lsp_types::Url`].
 | 
			
		||||
macro_rules! define_document_url {
 | 
			
		||||
    ($params:ident: &$p:ty) => {
 | 
			
		||||
        fn document_url($params: &$p) -> std::borrow::Cow<lsp_types::Url> {
 | 
			
		||||
        fn document_url($params: &$p) -> std::borrow::Cow<'_, lsp_types::Url> {
 | 
			
		||||
            std::borrow::Cow::Borrowed(&$params.text_document.uri)
 | 
			
		||||
        }
 | 
			
		||||
    };
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -21,7 +21,7 @@ impl super::RequestHandler for CodeActionResolve {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
impl super::BackgroundDocumentRequestHandler for CodeActionResolve {
 | 
			
		||||
    fn document_url(params: &types::CodeAction) -> Cow<types::Url> {
 | 
			
		||||
    fn document_url(params: &types::CodeAction) -> Cow<'_, types::Url> {
 | 
			
		||||
        let uri: lsp_types::Url = serde_json::from_value(params.data.clone().unwrap_or_default())
 | 
			
		||||
            .expect("code actions should have a URI in their data fields");
 | 
			
		||||
        Cow::Owned(uri)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -15,7 +15,7 @@ impl super::RequestHandler for Hover {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
impl super::BackgroundDocumentRequestHandler for Hover {
 | 
			
		||||
    fn document_url(params: &types::HoverParams) -> std::borrow::Cow<lsp_types::Url> {
 | 
			
		||||
    fn document_url(params: &types::HoverParams) -> std::borrow::Cow<'_, lsp_types::Url> {
 | 
			
		||||
        std::borrow::Cow::Borrowed(¶ms.text_document_position_params.text_document.uri)
 | 
			
		||||
    }
 | 
			
		||||
    fn run_with_snapshot(
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -62,7 +62,7 @@ pub(super) trait BackgroundDocumentRequestHandler: RequestHandler {
 | 
			
		|||
    /// [`define_document_url`]: super::define_document_url
 | 
			
		||||
    fn document_url(
 | 
			
		||||
        params: &<<Self as RequestHandler>::RequestType as Request>::Params,
 | 
			
		||||
    ) -> std::borrow::Cow<lsp_types::Url>;
 | 
			
		||||
    ) -> std::borrow::Cow<'_, lsp_types::Url>;
 | 
			
		||||
 | 
			
		||||
    fn run_with_snapshot(
 | 
			
		||||
        snapshot: DocumentSnapshot,
 | 
			
		||||
| 
						 | 
				
			
			@ -100,7 +100,7 @@ pub(super) trait BackgroundDocumentNotificationHandler: NotificationHandler {
 | 
			
		|||
    /// [`define_document_url`]: super::define_document_url
 | 
			
		||||
    fn document_url(
 | 
			
		||||
        params: &<<Self as NotificationHandler>::NotificationType as LSPNotification>::Params,
 | 
			
		||||
    ) -> std::borrow::Cow<lsp_types::Url>;
 | 
			
		||||
    ) -> std::borrow::Cow<'_, lsp_types::Url>;
 | 
			
		||||
 | 
			
		||||
    fn run_with_snapshot(
 | 
			
		||||
        snapshot: DocumentSnapshot,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -619,7 +619,7 @@ impl DocumentQuery {
 | 
			
		|||
    /// Get the path for the document selected by this query, ignoring whether the file exists on disk.
 | 
			
		||||
    ///
 | 
			
		||||
    /// Returns the URL's path if this is an unsaved (untitled) document.
 | 
			
		||||
    pub(crate) fn virtual_file_path(&self) -> Cow<Path> {
 | 
			
		||||
    pub(crate) fn virtual_file_path(&self) -> Cow<'_, Path> {
 | 
			
		||||
        self.file_path()
 | 
			
		||||
            .map(Cow::Owned)
 | 
			
		||||
            .unwrap_or_else(|| Cow::Borrowed(Path::new(self.file_url().path())))
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue