From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: dick Newsgroups: gmane.emacs.bugs Subject: bug#57669: 29.0.50; C-n, C-p off under long lines Date: Fri, 09 Sep 2022 12:30:46 -0400 Message-ID: <87v8pwfr2h.fsf@dick> References: <87y1uujufi.fsf@dick> <83k06effg6.fsf@gnu.org> <87tu5ijcqg.fsf@dick> <2e25ca87e3d9ee13ba3e@heytings.org> <87illxka46.fsf@dick> <8335d1dr39.fsf@gnu.org> <87mtb8hezl.fsf@dick> <87edwkhb0r.fsf@dick> <874jxgh9is.fsf@dick> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7525"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.14 (Gnus v5.14) Commercial/29.0.50 (gnu/linux) Cc: 57669@debbugs.gnu.org To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 09 21:11:26 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oWjPP-0008b9-VT for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Sep 2022 21:11:24 +0200 Original-Received: from localhost ([::1]:52454 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oWjPO-0006nO-VO for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Sep 2022 15:11:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52342) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oWjP6-0006li-Jc for bug-gnu-emacs@gnu.org; Fri, 09 Sep 2022 15:11:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46827) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oWjP6-0005Fg-9A for bug-gnu-emacs@gnu.org; Fri, 09 Sep 2022 15:11:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oWjP6-00089p-3v for bug-gnu-emacs@gnu.org; Fri, 09 Sep 2022 15:11:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: dick Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Sep 2022 19:11:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57669 X-GNU-PR-Package: emacs Original-Received: via spool by 57669-submit@debbugs.gnu.org id=B57669.166275064231264 (code B ref 57669); Fri, 09 Sep 2022 19:11:04 +0000 Original-Received: (at 57669) by debbugs.gnu.org; 9 Sep 2022 19:10:42 +0000 Original-Received: from localhost ([127.0.0.1]:35514 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oWjOj-000888-Qo for submit@debbugs.gnu.org; Fri, 09 Sep 2022 15:10:41 -0400 Original-Received: from mail-qk1-f174.google.com ([209.85.222.174]:45946) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oWgu7-0001IG-LV for 57669@debbugs.gnu.org; Fri, 09 Sep 2022 12:30:55 -0400 Original-Received: by mail-qk1-f174.google.com with SMTP id b2so1543757qkh.12 for <57669@debbugs.gnu.org>; Fri, 09 Sep 2022 09:30:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date; bh=g+UZWxm2B3/HTGoXsDCAw+Uaf0ia256f8oojXhnbwLc=; b=lyAUajsgUQT1T2WHmsfPbsEoFsztgMK1XXIIgVEqVqShPFDZhx5nLgw4jQdQ27iqWI KSNBdy6NCkBFwWqoIjWbma/1Y8nrg18W12lSXVOpZ41ZS4qwR4Q6lu2Nx2oIoFF4rdFH W/Kyx/aUXkG1AJh28NfiazTaqoGV0qxowU4AlQ0JJvRbRxHDyHHPi2NeSgROebl5ElOZ 4DAFWMuLU+T6tpkzoeo9bfFw4mdosMcFC9A6/OzWGs37aRcFIe1RDfcCwUijh2SUrnnm ysNwdPmEP0YuENlLNjsan3hxirYZGS58zo3Rz7vs0VAWPawyefXKHpdxW/FwtQ8prML1 /N3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date; bh=g+UZWxm2B3/HTGoXsDCAw+Uaf0ia256f8oojXhnbwLc=; b=pR/fJ6tP5s1ZrCkqVfn7nsQJ2A5PuyxqVI3Ry8gKP3DZmCnG2b8x7U8t4JSuZlYht+ KZoRhdk/eXvokatjaeHlwAlvN6iu5yRHrr0uxQgFEZu5te82Gj/Z0+qBpJxA8qtMUZLa dNsjBAKqP564SROn5ObmtWhSvB4E62QMp5Vl3SyMHlfDVlklRiAjU6TE4dlm+/zEs5j1 z5/VUQW6HJEywmi5ZWXe87qbj7vtknytZU3KBJYjWBsLZAYdWW+Zr22qmOsNSvNXsC5t BK9krdVqHnH6s5qqLMbDldWT6MIR3mqQf+zxflXpqIqjq9uquG5RaIakWph8FTEj7Kdy rH+w== X-Gm-Message-State: ACgBeo0N0LKhc5rueqflNXbSI2HEXusux3MZuEPmZZhyw3vuL+zGEuze HKsjIzSC5OjF3nHj0lB4rqc= X-Google-Smtp-Source: AA6agR5ei+N4X1sM1AC8xoQ4XvP0Fk3/MCG2NB1bf7q+VCpMJjp2o6Yx+5PaQehqCYEnRcQOsVLVpw== X-Received: by 2002:a05:620a:2182:b0:6cd:ccbd:5c38 with SMTP id g2-20020a05620a218200b006cdccbd5c38mr2111598qka.695.1662741049619; Fri, 09 Sep 2022 09:30:49 -0700 (PDT) Original-Received: from localhost (pool-173-56-234-28.nycmny.fios.verizon.net. [173.56.234.28]) by smtp.gmail.com with ESMTPSA id e22-20020ac85996000000b00344b807bb95sm722644qte.74.2022.09.09.09.30.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Sep 2022 09:30:48 -0700 (PDT) In-Reply-To: (Gregory Heytings's message of "Fri, 09 Sep 2022 15:41:39 +0000") X-Mailman-Approved-At: Fri, 09 Sep 2022 15:10:17 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:242033 Archived-At: --=-=-= Content-Type: text/plain > A rather strange conclusion. --=-=-= Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename=languageclient.out Content-Transfer-Encoding: quoted-printable ####### LanguageClient 0.1.161 ####### 16:30:46 DEBUG unnamed src/language_client.rs:108 state: null =3D=3D> {"cap= abilities":{},"code_lens":{},"diagnostics":{},"highlight_match_ids":[],"hig= hlight_source":null,"highlights":{},"highlights_placed":{},"initialization_= options":null,"inlay_hints":{},"last_cursor_line":0,"last_line_diagnostic":= " ","logger":{"level":"DEBUG","path":"/tmp/shiz"},"namespace_ids":{},"regis= trations":[],"roots":{},"semantic_highlights":{},"semantic_scope_to_hl_grou= p_table":{},"semantic_scopes":{},"stashed_code_action_actions":[],"text_doc= uments":{},"text_documents_metadata":{},"user_handlers":{},"viewports":{}} 16:30:46 INFO unnamed src/language_server_protocol.rs:3580 settings synced 16:30:46 INFO unnamed src/language_server_protocol.rs:3607 Project root: /h= ome/dick/LanguageClient-neovim 16:30:46 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:EchomsgEllipsis","params":["Project root: /home/dick/LanguageCl= ient-neovim"]} 16:30:46 DEBUG unnamed src/language_client.rs:108 state.roots.rust: null = =3D=3D> "/home/dick/LanguageClient-neovim" 16:30:46 INFO unnamed src/language_server_protocol.rs:840 initialize; param= s=3DObject({"bufnr": Number(1), "filename": String("/home/dick/LanguageClie= nt-neovim/src/rpcclient.rs"), "languageId": String("rust"), "position": Obj= ect({"character": Number(0), "line": Number(0)}), "viewport": Object({"end"= : Number(20), "start": Number(0)})}) 16:30:46 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:command","params":["sign define LanguageClientWarning text=3D t= exthl=3DLanguageClientWarningSign","sign define LanguageClientError text=3D= texthl=3DLanguageClientErrorSign","sign define LanguageClientInformation t= ext=3D texthl=3DLanguageClientInfoSign","sign define LanguageClientHint tex= t=3D texthl=3DLanguageClientInfoSign"]} 16:30:46 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"eval","params":["s:hasSnippetSupport()"],"id":3} 16:30:46 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 3, "jsonrp= c": "2.0", "result": 0} 16:30:46 DEBUG writer-Some("rust") src/rpcclient.rs:254 =3D> Some("rust") {= "jsonrpc":"2.0","method":"initialize","params":{"capabilities":{"textDocume= nt":{"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet"= :["quickfix","refactor","refactor.extract","refactor.inline","refactor.rewr= ite","source","source.organizeImports"]}}},"codeLens":{"dynamicRegistration= ":true},"colorProvider":{"dynamicRegistration":false},"completion":{"comple= tionItem":{"insertReplaceSupport":false,"snippetSupport":false}},"declarati= on":{"linkSupport":true},"definition":{"linkSupport":true},"hover":{},"impl= ementation":{"linkSupport":true},"publishDiagnostics":{"relatedInformation"= :true},"semanticHighlightingCapabilities":{"semanticHighlighting":true},"si= gnatureHelp":{"signatureInformation":{"parameterInformation":{"labelOffsetS= upport":true}}},"typeDefinition":{"linkSupport":true}},"workspace":{"applyE= dit":true,"didChangeWatchedFiles":{"dynamicRegistration":true}}},"clientInf= o":{"name":"LanguageClient-neovim","version":"0.1.161"},"processId":243451,= "rootPath":"/home/dick/LanguageClient-neovim","rootUri":"file:///home/dick/= LanguageClient-neovim","trace":"off"},"id":0} 16:30:46 DEBUG reader-Some("rust") src/rpcclient.rs:207 <=3D Some("rust") {= "jsonrpc":"2.0","id":0,"result":{"capabilities":{"textDocumentSync":{"openC= lose":true,"change":2,"save":{}},"selectionRangeProvider":true,"hoverProvid= er":true,"completionProvider":{"triggerCharacters":[":",".","'","("],"compl= etionItem":{"labelDetailsSupport":false}},"signatureHelpProvider":{"trigger= Characters":["(",",","<"]},"definitionProvider":true,"typeDefinitionProvide= r":true,"implementationProvider":true,"referencesProvider":true,"documentHi= ghlightProvider":true,"documentSymbolProvider":true,"workspaceSymbolProvide= r":true,"codeActionProvider":{"codeActionKinds":["","quickfix","refactor","= refactor.extract","refactor.inline","refactor.rewrite"],"resolveProvider":t= rue},"codeLensProvider":{"resolveProvider":true},"documentFormattingProvide= r":true,"documentRangeFormattingProvider":false,"documentOnTypeFormattingPr= ovider":{"firstTriggerCharacter":"=3D","moreTriggerCharacter":[".",">","{"]= },"renameProvider":{"prepareProvider":true},"foldingRangeProvider":true,"de= clarationProvider":true,"workspace":{"fileOperations":{"willRename":{"filte= rs":[{"scheme":"file","pattern":{"glob":"**/*.rs","matches":"file"}},{"sche= me":"file","pattern":{"glob":"**","matches":"folder"}}]}}},"callHierarchyPr= ovider":true,"semanticTokensProvider":{"legend":{"tokenTypes":["comment","d= ecorator","enumMember","enum","function","interface","keyword","macro","met= hod","namespace","number","operator","parameter","property","string","struc= t","typeParameter","variable","angle","arithmetic","attribute","attributeBr= acket","bitwise","boolean","brace","bracket","builtinAttribute","builtinTyp= e","character","colon","comma","comparison","constParameter","derive","deri= veHelper","dot","escapeSequence","formatSpecifier","generic","label","lifet= ime","logical","macroBang","parenthesis","punctuation","selfKeyword","selfT= ypeKeyword","semicolon","typeAlias","toolModule","union","unresolvedReferen= ce"],"tokenModifiers":["documentation","declaration","static","defaultLibra= ry","async","attribute","callable","constant","consuming","controlFlow","cr= ateRoot","injected","intraDocLink","library","mutable","public","reference"= ,"trait","unsafe"]},"range":true,"full":{"delta":true}},"inlayHintProvider"= :{"resolveProvider":true},"experimental":{"externalDocs":true,"hoverRange":= true,"joinLines":true,"matchingBrace":true,"moveItem":true,"onEnter":true,"= openCargoToml":true,"parentModule":true,"runnables":{"kinds":["cargo"]},"ss= r":true,"workspaceSymbolScopeKindFiltering":true}},"serverInfo":{"name":"ru= st-analyzer","version":"0.0.0 (8ddb8b7e8 2022-09-03)"}}} 16:30:46 DEBUG unnamed src/language_client.rs:108 state.capabilities.rust: = null =3D=3D> {"capabilities":{"callHierarchyProvider":true,"codeActionProvi= der":{"codeActionKinds":["","quickfix","refactor","refactor.extract","refac= tor.inline","refactor.rewrite"],"resolveProvider":true},"codeLensProvider":= {"resolveProvider":true},"completionProvider":{"triggerCharacters":[":","."= ,"'","("]},"declarationProvider":true,"definitionProvider":true,"documentFo= rmattingProvider":true,"documentHighlightProvider":true,"documentOnTypeForm= attingProvider":{"firstTriggerCharacter":"=3D","moreTriggerCharacter":[".",= ">","{"]},"documentRangeFormattingProvider":false,"documentSymbolProvider":= true,"experimental":{"externalDocs":true,"hoverRange":true,"joinLines":true= ,"matchingBrace":true,"moveItem":true,"onEnter":true,"openCargoToml":true,"= parentModule":true,"runnables":{"kinds":["cargo"]},"ssr":true,"workspaceSym= bolScopeKindFiltering":true},"foldingRangeProvider":true,"hoverProvider":tr= ue,"implementationProvider":true,"referencesProvider":true,"renameProvider"= :{"prepareProvider":true},"selectionRangeProvider":true,"semanticTokensProv= ider":{"full":{"delta":true},"legend":{"tokenModifiers":["documentation","d= eclaration","static","defaultLibrary","async","attribute","callable","const= ant","consuming","controlFlow","crateRoot","injected","intraDocLink","libra= ry","mutable","public","reference","trait","unsafe"],"tokenTypes":["comment= ","decorator","enumMember","enum","function","interface","keyword","macro",= "method","namespace","number","operator","parameter","property","string","s= truct","typeParameter","variable","angle","arithmetic","attribute","attribu= teBracket","bitwise","boolean","brace","bracket","builtinAttribute","builti= nType","character","colon","comma","comparison","constParameter","derive","= deriveHelper","dot","escapeSequence","formatSpecifier","generic","label","l= ifetime","logical","macroBang","parenthesis","punctuation","selfKeyword","s= elfTypeKeyword","semicolon","typeAlias","toolModule","union","unresolvedRef= erence"]},"range":true},"signatureHelpProvider":{"triggerCharacters":["(","= ,","<"]},"textDocumentSync":{"change":2,"openClose":true,"save":{}},"typeDe= finitionProvider":true,"workspace":{},"workspaceSymbolProvider":true},"serv= erInfo":{"name":"rust-analyzer","version":"0.0.0 (8ddb8b7e8 2022-09-03)"}} 16:30:46 INFO unnamed src/language_server_protocol.rs:567 register_cm_sourc= e; language_id=3D"rust" result=3DObject({"capabilities": Object({"callHiera= rchyProvider": Bool(true), "codeActionProvider": Object({"codeActionKinds":= Array([String(""), String("quickfix"), String("refactor"), String("refacto= r.extract"), String("refactor.inline"), String("refactor.rewrite")]), "reso= lveProvider": Bool(true)}), "codeLensProvider": Object({"resolveProvider": = Bool(true)}), "completionProvider": Object({"completionItem": Object({"labe= lDetailsSupport": Bool(false)}), "triggerCharacters": Array([String(":"), S= tring("."), String("'"), String("(")])}), "declarationProvider": Bool(true)= , "definitionProvider": Bool(true), "documentFormattingProvider": Bool(true= ), "documentHighlightProvider": Bool(true), "documentOnTypeFormattingProvid= er": Object({"firstTriggerCharacter": String("=3D"), "moreTriggerCharacter"= : Array([String("."), String(">"), String("{")])}), "documentRangeFormattin= gProvider": Bool(false), "documentSymbolProvider": Bool(true), "experimenta= l": Object({"externalDocs": Bool(true), "hoverRange": Bool(true), "joinLine= s": Bool(true), "matchingBrace": Bool(true), "moveItem": Bool(true), "onEnt= er": Bool(true), "openCargoToml": Bool(true), "parentModule": Bool(true), "= runnables": Object({"kinds": Array([String("cargo")])}), "ssr": Bool(true),= "workspaceSymbolScopeKindFiltering": Bool(true)}), "foldingRangeProvider":= Bool(true), "hoverProvider": Bool(true), "implementationProvider": Bool(tr= ue), "inlayHintProvider": Object({"resolveProvider": Bool(true)}), "referen= cesProvider": Bool(true), "renameProvider": Object({"prepareProvider": Bool= (true)}), "selectionRangeProvider": Bool(true), "semanticTokensProvider": O= bject({"full": Object({"delta": Bool(true)}), "legend": Object({"tokenModif= iers": Array([String("documentation"), String("declaration"), String("stati= c"), String("defaultLibrary"), String("async"), String("attribute"), String= ("callable"), String("constant"), String("consuming"), String("controlFlow"= ), String("crateRoot"), String("injected"), String("intraDocLink"), String(= "library"), String("mutable"), String("public"), String("reference"), Strin= g("trait"), String("unsafe")]), "tokenTypes": Array([String("comment"), Str= ing("decorator"), String("enumMember"), String("enum"), String("function"),= String("interface"), String("keyword"), String("macro"), String("method"),= String("namespace"), String("number"), String("operator"), String("paramet= er"), String("property"), String("string"), String("struct"), String("typeP= arameter"), String("variable"), String("angle"), String("arithmetic"), Stri= ng("attribute"), String("attributeBracket"), String("bitwise"), String("boo= lean"), String("brace"), String("bracket"), String("builtinAttribute"), Str= ing("builtinType"), String("character"), String("colon"), String("comma"), = String("comparison"), String("constParameter"), String("derive"), String("d= eriveHelper"), String("dot"), String("escapeSequence"), String("formatSpeci= fier"), String("generic"), String("label"), String("lifetime"), String("log= ical"), String("macroBang"), String("parenthesis"), String("punctuation"), = String("selfKeyword"), String("selfTypeKeyword"), String("semicolon"), Stri= ng("typeAlias"), String("toolModule"), String("union"), String("unresolvedR= eference")])}), "range": Bool(true)}), "signatureHelpProvider": Object({"tr= iggerCharacters": Array([String("("), String(","), String("<")])}), "textDo= cumentSync": Object({"change": Number(2), "openClose": Bool(true), "save": = Object({})}), "typeDefinitionProvider": Bool(true), "workspace": Object({"f= ileOperations": Object({"willRename": Object({"filters": Array([Object({"pa= ttern": Object({"glob": String("**/*.rs"), "matches": String("file")}), "sc= heme": String("file")}), Object({"pattern": Object({"glob": String("**"), "= matches": String("folder")}), "scheme": String("file")})])})})}), "workspac= eSymbolProvider": Bool(true)}), "serverInfo": Object({"name": String("rust-= analyzer"), "version": String("0.0.0 (8ddb8b7e8 2022-09-03)")})}) 16:30:46 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"eval","params":["exists('g:cm_matcher')"],"id":4} 16:30:46 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 4, "jsonrp= c": "2.0", "result": 0} 16:30:46 INFO unnamed src/language_server_protocol.rs:607 register_ncm2_sou= rce; language_id=3D"rust" result=3DObject({"capabilities": Object({"callHie= rarchyProvider": Bool(true), "codeActionProvider": Object({"codeActionKinds= ": Array([String(""), String("quickfix"), String("refactor"), String("refac= tor.extract"), String("refactor.inline"), String("refactor.rewrite")]), "re= solveProvider": Bool(true)}), "codeLensProvider": Object({"resolveProvider"= : Bool(true)}), "completionProvider": Object({"completionItem": Object({"la= belDetailsSupport": Bool(false)}), "triggerCharacters": Array([String(":"),= String("."), String("'"), String("(")])}), "declarationProvider": Bool(tru= e), "definitionProvider": Bool(true), "documentFormattingProvider": Bool(tr= ue), "documentHighlightProvider": Bool(true), "documentOnTypeFormattingProv= ider": Object({"firstTriggerCharacter": String("=3D"), "moreTriggerCharacte= r": Array([String("."), String(">"), String("{")])}), "documentRangeFormatt= ingProvider": Bool(false), "documentSymbolProvider": Bool(true), "experimen= tal": Object({"externalDocs": Bool(true), "hoverRange": Bool(true), "joinLi= nes": Bool(true), "matchingBrace": Bool(true), "moveItem": Bool(true), "onE= nter": Bool(true), "openCargoToml": Bool(true), "parentModule": Bool(true),= "runnables": Object({"kinds": Array([String("cargo")])}), "ssr": Bool(true= ), "workspaceSymbolScopeKindFiltering": Bool(true)}), "foldingRangeProvider= ": Bool(true), "hoverProvider": Bool(true), "implementationProvider": Bool(= true), "inlayHintProvider": Object({"resolveProvider": Bool(true)}), "refer= encesProvider": Bool(true), "renameProvider": Object({"prepareProvider": Bo= ol(true)}), "selectionRangeProvider": Bool(true), "semanticTokensProvider":= Object({"full": Object({"delta": Bool(true)}), "legend": Object({"tokenMod= ifiers": Array([String("documentation"), String("declaration"), String("sta= tic"), String("defaultLibrary"), String("async"), String("attribute"), Stri= ng("callable"), String("constant"), String("consuming"), String("controlFlo= w"), String("crateRoot"), String("injected"), String("intraDocLink"), Strin= g("library"), String("mutable"), String("public"), String("reference"), Str= ing("trait"), String("unsafe")]), "tokenTypes": Array([String("comment"), S= tring("decorator"), String("enumMember"), String("enum"), String("function"= ), String("interface"), String("keyword"), String("macro"), String("method"= ), String("namespace"), String("number"), String("operator"), String("param= eter"), String("property"), String("string"), String("struct"), String("typ= eParameter"), String("variable"), String("angle"), String("arithmetic"), St= ring("attribute"), String("attributeBracket"), String("bitwise"), String("b= oolean"), String("brace"), String("bracket"), String("builtinAttribute"), S= tring("builtinType"), String("character"), String("colon"), String("comma")= , String("comparison"), String("constParameter"), String("derive"), String(= "deriveHelper"), String("dot"), String("escapeSequence"), String("formatSpe= cifier"), String("generic"), String("label"), String("lifetime"), String("l= ogical"), String("macroBang"), String("parenthesis"), String("punctuation")= , String("selfKeyword"), String("selfTypeKeyword"), String("semicolon"), St= ring("typeAlias"), String("toolModule"), String("union"), String("unresolve= dReference")])}), "range": Bool(true)}), "signatureHelpProvider": Object({"= triggerCharacters": Array([String("("), String(","), String("<")])}), "text= DocumentSync": Object({"change": Number(2), "openClose": Bool(true), "save"= : Object({})}), "typeDefinitionProvider": Bool(true), "workspace": Object({= "fileOperations": Object({"willRename": Object({"filters": Array([Object({"= pattern": Object({"glob": String("**/*.rs"), "matches": String("file")}), "= scheme": String("file")}), Object({"pattern": Object({"glob": String("**"),= "matches": String("folder")}), "scheme": String("file")})])})})}), "worksp= aceSymbolProvider": Bool(true)}), "serverInfo": Object({"name": String("rus= t-analyzer"), "version": String("0.0.0 (8ddb8b7e8 2022-09-03)")})}) 16:30:46 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"eval","params":["exists('g:ncm2_loaded')"],"id":5} 16:30:46 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 5, "jsonrp= c": "2.0", "result": 0} 16:30:46 INFO unnamed src/language_server_protocol.rs:647 parse_semantic_sc= opes; language_id=3D"rust" result=3DObject({"capabilities": Object({"callHi= erarchyProvider": Bool(true), "codeActionProvider": Object({"codeActionKind= s": Array([String(""), String("quickfix"), String("refactor"), String("refa= ctor.extract"), String("refactor.inline"), String("refactor.rewrite")]), "r= esolveProvider": Bool(true)}), "codeLensProvider": Object({"resolveProvider= ": Bool(true)}), "completionProvider": Object({"completionItem": Object({"l= abelDetailsSupport": Bool(false)}), "triggerCharacters": Array([String(":")= , String("."), String("'"), String("(")])}), "declarationProvider": Bool(tr= ue), "definitionProvider": Bool(true), "documentFormattingProvider": Bool(t= rue), "documentHighlightProvider": Bool(true), "documentOnTypeFormattingPro= vider": Object({"firstTriggerCharacter": String("=3D"), "moreTriggerCharact= er": Array([String("."), String(">"), String("{")])}), "documentRangeFormat= tingProvider": Bool(false), "documentSymbolProvider": Bool(true), "experime= ntal": Object({"externalDocs": Bool(true), "hoverRange": Bool(true), "joinL= ines": Bool(true), "matchingBrace": Bool(true), "moveItem": Bool(true), "on= Enter": Bool(true), "openCargoToml": Bool(true), "parentModule": Bool(true)= , "runnables": Object({"kinds": Array([String("cargo")])}), "ssr": Bool(tru= e), "workspaceSymbolScopeKindFiltering": Bool(true)}), "foldingRangeProvide= r": Bool(true), "hoverProvider": Bool(true), "implementationProvider": Bool= (true), "inlayHintProvider": Object({"resolveProvider": Bool(true)}), "refe= rencesProvider": Bool(true), "renameProvider": Object({"prepareProvider": B= ool(true)}), "selectionRangeProvider": Bool(true), "semanticTokensProvider"= : Object({"full": Object({"delta": Bool(true)}), "legend": Object({"tokenMo= difiers": Array([String("documentation"), String("declaration"), String("st= atic"), String("defaultLibrary"), String("async"), String("attribute"), Str= ing("callable"), String("constant"), String("consuming"), String("controlFl= ow"), String("crateRoot"), String("injected"), String("intraDocLink"), Stri= ng("library"), String("mutable"), String("public"), String("reference"), St= ring("trait"), String("unsafe")]), "tokenTypes": Array([String("comment"), = String("decorator"), String("enumMember"), String("enum"), String("function= "), String("interface"), String("keyword"), String("macro"), String("method= "), String("namespace"), String("number"), String("operator"), String("para= meter"), String("property"), String("string"), String("struct"), String("ty= peParameter"), String("variable"), String("angle"), String("arithmetic"), S= tring("attribute"), String("attributeBracket"), String("bitwise"), String("= boolean"), String("brace"), String("bracket"), String("builtinAttribute"), = String("builtinType"), String("character"), String("colon"), String("comma"= ), String("comparison"), String("constParameter"), String("derive"), String= ("deriveHelper"), String("dot"), String("escapeSequence"), String("formatSp= ecifier"), String("generic"), String("label"), String("lifetime"), String("= logical"), String("macroBang"), String("parenthesis"), String("punctuation"= ), String("selfKeyword"), String("selfTypeKeyword"), String("semicolon"), S= tring("typeAlias"), String("toolModule"), String("union"), String("unresolv= edReference")])}), "range": Bool(true)}), "signatureHelpProvider": Object({= "triggerCharacters": Array([String("("), String(","), String("<")])}), "tex= tDocumentSync": Object({"change": Number(2), "openClose": Bool(true), "save= ": Object({})}), "typeDefinitionProvider": Bool(true), "workspace": Object(= {"fileOperations": Object({"willRename": Object({"filters": Array([Object({= "pattern": Object({"glob": String("**/*.rs"), "matches": String("file")}), = "scheme": String("file")}), Object({"pattern": Object({"glob": String("**")= , "matches": String("folder")}), "scheme": String("file")})])})})}), "works= paceSymbolProvider": Bool(true)}), "serverInfo": Object({"name": String("ru= st-analyzer"), "version": String("0.0.0 (8ddb8b7e8 2022-09-03)")})}) 16:30:46 INFO unnamed src/language_server_protocol.rs:1019 initialized; par= ams=3DObject({"bufnr": Number(1), "filename": String("/home/dick/LanguageCl= ient-neovim/src/rpcclient.rs"), "languageId": String("rust"), "position": O= bject({"character": Number(0), "line": Number(0)}), "viewport": Object({"en= d": Number(20), "start": Number(0)})}) 16:30:46 INFO unnamed src/language_server_protocol.rs:666 update_semantic_h= ighlight_tables; language_id=3D"rust" 16:30:46 DEBUG writer-Some("rust") src/rpcclient.rs:254 =3D> Some("rust") {= "jsonrpc":"2.0","method":"initialized","params":{}} 16:30:46 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"eval","params":["LSP#filename()"],"id":6} 16:30:46 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 6, "jsonrp= c": "2.0", "result": "/home/dick/LanguageClient-neovim/src/rpcclient.rs"} 16:30:46 INFO unnamed src/language_server_protocol.rs:1946 text_document_di= d_open; params=3DObject({"bufnr": Number(1), "filename": String("/home/dick= /LanguageClient-neovim/src/rpcclient.rs"), "languageId": String("rust"), "p= osition": Object({"character": Number(0), "line": Number(0)}), "viewport": = Object({"end": Number(20), "start": Number(0)})}) 16:30:46 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"setbufvar","params":["/home/dick/LanguageClient-neovim/src/rpccli= ent.rs","LanguageClient_isServerRunning",1]} 16:30:46 DEBUG writer-Some("rust") src/rpcclient.rs:254 =3D> Some("rust") {= "jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{"sett= ings":{"rust":{"all_targets":false,"build_on_save":true,"clippy_preference"= :"on","wait_to_build":0}}}} 16:30:46 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:ExecuteAutocmd","params":["LanguageClientStarted"]} 16:30:46 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"LSP#text","params":["/home/dick/LanguageClient-neovim/src/rpcclie= nt.rs"],"id":7} 16:30:46 DEBUG reader-Some("rust") src/rpcclient.rs:207 <=3D Some("rust") {= "jsonrpc":"2.0","id":0,"method":"workspace/configuration","params":{"items"= :[{"section":"rust-analyzer"}]}} 16:30:46 ERROR unnamed src/rpchandler.rs:27 Error handling message: Message= not handled: MethodCall { jsonrpc: Some(V2), method: "workspace/configurat= ion", params: Map({"items": Array([Object({"section": String("rust-analyzer= ")})])}), id: Num(0) } Message: {"jsonrpc":"2.0","method":"workspace/configuration","params":{"ite= ms":[{"section":"rust-analyzer"}]},"id":0} Error: Message not handled: MethodCall { jsonrpc: Some(V2), method: "worksp= ace/configuration", params: Map({"items": Array([Object({"section": String(= "rust-analyzer")})])}), id: Num(0) } 16:30:46 DEBUG writer-Some("rust") src/rpcclient.rs:254 =3D> Some("rust") {= "jsonrpc":"2.0","error":{"code":-32603,"message":"Message not handled: Meth= odCall { jsonrpc: Some(V2), method: \"workspace/configuration\", params: Ma= p({\"items\": Array([Object({\"section\": String(\"rust-analyzer\")})])}), = id: Num(0) }"},"id":0} 16:30:46 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 7, "jsonrp= c": "2.0", "result": ["use crate::types::{Call, Id, LSError, LanguageId, Ra= wMessage, ToInt, ToParams, ToRpcError};", "use anyhow::{anyhow, Result};", = "use crossbeam::channel::{bounded, unbounded, Receiver, Sender};", "use log= ::*;", "use regex::Regex;", "use serde::{de::DeserializeOwned, Serialize};"= , "use std::io::Write;", "use std::str::FromStr;", "use std::{", " colle= ctions::HashMap,", " io::BufRead,", " sync::atomic::{AtomicU64, Order= ing},", " thread,", " time::Duration,", "};", "", "const CONTENT_MODI= FIED_ERROR_CODE: i64 =3D -32801;", "", "lazy_static! {", " // this regex= is used to remove some additional fields that we get from some servers, na= mely:", " // meta, sent by javascript-typescript-langserver and requestM= ethod, sent by Sorbet.", " static ref RE_REMOVE_EXTRA_FIELDS: Regex =3D"= , " Regex::new(r#\",\\s?\"(?:meta|requestMethod)\":(?:\"\\w+(/\\w+)?= \"|\\{\\})\"#).unwrap();", "}", "", "#[derive(Serialize)]", "pub struct Rpc= Client {", " language_id: LanguageId,", " #[serde(skip_serializing)]"= , " id: AtomicU64,", " #[serde(skip_serializing)]", " writer_tx: S= ender,", " #[serde(skip_serializing)]", " reader_tx: Send= er<(Id, Sender)>,", " pub process_id: Option,= ", "}", "", "impl RpcClient {", " #[allow(clippy::new_ret_no_self)]", " = pub fn new(", " language_id: LanguageId,", " reader: impl = BufRead + Send + 'static,", " writer: impl Write + Send + 'static,",= " process_id: Option,", " sink: Sender,", " = on_crash: impl Fn(&LanguageId) + Clone + Send + 'static,", " ) -> Resu= lt {", " let (reader_tx, reader_rx): (Sender<(Id, Sender)>, _) =3D unbounded();", "", " let language_id_clon= e =3D language_id.clone();", " let reader_thread_name =3D format!(\"= reader-{:?}\", language_id);", " let on_crash_clone =3D on_crash.clo= ne();", " thread::Builder::new()", " .name(reader_thread_= name.clone())", " .spawn(move || {", " if let Err= (err) =3D loop_read(reader, reader_rx, &sink, &language_id_clone) {", " = match err.downcast_ref::() {", " = Some(err) if err.kind() =3D=3D std::io::ErrorKind::UnexpectedE= of =3D> {", " on_crash_clone(&language_id_clone)= ", " }", " _ =3D> {}", " = }", "", " error!(\"Thread {} exited with = error: {:?}\", reader_thread_name, err);", " }", " = })?;", "", " let (writer_tx, writer_rx) =3D unbounded();", " = let writer_thread_name =3D format!(\"writer-{:?}\", language_id);", " = let language_id_clone =3D language_id.clone();", " thread::Build= er::new()", " .name(writer_thread_name.clone())", " .= spawn(move || {", " if let Err(err) =3D loop_write(writer, &= writer_rx, &language_id_clone) {", " match err.downcast_= ref::() {", " Some(err) if err.kind(= ) =3D=3D std::io::ErrorKind::BrokenPipe =3D> {", " = on_crash(&language_id_clone)", " }", " = _ =3D> {}", " }", "", " = error!(\"Thread {} exited with error: {:?}\", writer_thread_name, err);", "= }", " })?;", "", " Ok(Self {", " = language_id,", " id: AtomicU64::default(),", " pro= cess_id,", " reader_tx,", " writer_tx,", " })"= , " }", "", " pub fn call(", " &self,", "= method: impl AsRef,", " params: impl Serialize,", " = ) -> Result {", " let method =3D method.as_ref();", " let = id =3D self.id.fetch_add(1, Ordering::SeqCst);", " let msg =3D jsonr= pc_core::MethodCall {", " jsonrpc: Some(jsonrpc_core::Version::V= 2),", " id: jsonrpc_core::Id::Num(id),", " method: me= thod.to_owned(),", " params: params.to_params()?,", " };"= , " let (tx, rx) =3D bounded(1);", " self.reader_tx.send((id,= tx))?;", " self.writer_tx.send(RawMessage::MethodCall(msg))?;", " = // TODO: duration from config.", " match rx.recv_timeout(Durat= ion::from_secs(60))? {", " jsonrpc_core::Output::Success(ok) =3D= > Ok(serde_json::from_value(ok.result)?),", " // NOTE: Errors wi= th code -32801 correspond to the protocol's ContentModified error,", " = // which we don't want to show to the user and should ignore, as the= result of the", " // request that triggered this error has been= invalidated by changes to the state", " // of the server, so we= must handle this error specifically.", " jsonrpc_core::Output::= Failure(err)", " if err.error.code.code() =3D=3D CONTENT_MOD= IFIED_ERROR_CODE =3D>", " {", " Err(anyhow::Error= ::from(LSError::ContentModified))", " }", " jsonrpc_c= ore::Output::Failure(err) =3D> Err(anyhow!(\"Error: {:?}\", err)),", " = }", " }", "", " pub fn notify(&self, method: impl AsRef, para= ms: impl Serialize) -> Result<()> {", " let method =3D method.as_ref= ();", "", " let msg =3D jsonrpc_core::Notification {", " = jsonrpc: Some(jsonrpc_core::Version::V2),", " method: method.to_= owned(),", " params: params.to_params()?,", " };", " = self.writer_tx.send(RawMessage::Notification(msg))?;", " Ok(())",= " }", "", " pub fn output(&self, id: Id, result: Result) -> Result<()> {", " let output =3D match result {", " = Ok(ok) =3D> jsonrpc_core::Output::Success(jsonrpc_core::Success {", " = jsonrpc: Some(jsonrpc_core::Version::V2),", " id= : jsonrpc_core::Id::Num(id),", " result: serde_json::to_valu= e(ok)?,", " }),", " Err(err) =3D> jsonrpc_core::Outpu= t::Failure(jsonrpc_core::Failure {", " jsonrpc: Some(jsonrpc= _core::Version::V2),", " id: jsonrpc_core::Id::Num(id),", " = error: err.to_rpc_error(),", " }),", " };"= , "", " self.writer_tx.send(RawMessage::Output(output))?;", " = Ok(())", " }", "}", "", "fn loop_read(", " reader: impl BufRead,", "= reader_rx: Receiver<(Id, Sender)>,", " sink: &= Sender,", " language_id: &LanguageId,", ") -> Result<()> {", " = let mut pending_outputs =3D HashMap::new();", "", " // Count how many co= nsequent empty lines.", " let mut count_empty_lines =3D 0;", "", " le= t mut reader =3D reader;", " let mut content_length =3D 0;", " loop {= ", " let mut message =3D String::new();", " let mut line =3D = String::new();", " if language_id.is_some() {", " reader.= read_line(&mut line)?;", " let line =3D line.trim();", " = if line.is_empty() {", " count_empty_lines +=3D 1;", " = if count_empty_lines > 5 {", " return Err(= anyhow!(\"Unable to read from language server\"));", " }", "= ", " let mut buf =3D vec![0; content_length];", " = reader.read_exact(buf.as_mut_slice())?;", " message =3D= String::from_utf8(buf)?;", " } else {", " count_= empty_lines =3D 0;", " if !line.starts_with(\"Content-Length= \") {", " continue;", " }", "", " = let tokens: Vec<&str> =3D line.splitn(2, ':').collect();", " = let len =3D tokens", " .get(1)", " = .ok_or_else(|| anyhow!(\"Failed to get length! tokens: {:?}\", token= s))?", " .trim();", " content_length =3D = usize::from_str(len)?;", " }", " } else if reader.read_li= ne(&mut message)? =3D=3D 0 {", " break;", " }", "", " = let message =3D message.trim();", " if message.is_empty() {", " = continue;", " }", " debug!(\"<=3D {:?} {}\", langu= age_id, message);", " // FIXME: Remove extra `meta` property from ja= vascript-typescript-langserver and", " // `requestMethod` sent by So= rbet.", " let s =3D RE_REMOVE_EXTRA_FIELDS.replace(message, \"\");",= " let message =3D serde_json::from_str(&s);", " if let Err(r= ef err) =3D message {", " error!(", " \"Failed to= deserialize output: {}\\n\\n Message: {}\\n\\nError: {:?}\",", " = err, s, err", " );", " continue;", " }",= " // TODO: cleanup.", " let message =3D message.unwrap();", = " match message {", " RawMessage::MethodCall(method_call)= =3D> {", " sink.send(Call::MethodCall(language_id.clone(), = method_call))?;", " }", " RawMessage::Notification(no= tification) =3D> {", " sink.send(Call::Notification(language= _id.clone(), notification))?;", " }", " RawMessage::O= utput(output) =3D> {", " while let Ok((id, tx)) =3D reader_r= x.try_recv() {", " pending_outputs.insert(id, tx);", " = }", "", " if let Some(tx) =3D pending_outputs.= remove(&output.id().to_int()?) {", " tx.send(output)", "= .map_err(|output| anyhow!(\"Failed to send output: = {:?}\", output))?;", " }", " }", " };", " = }", "", " info!(\"reader-{:?} terminated\", language_id);", " Ok((= ))", "}", "", "fn loop_write(", " writer: impl Write,", " rx: &Receiv= er,", " language_id: &LanguageId,", ") -> Result<()> {", " = let mut writer =3D writer;", "", " for msg in rx.iter() {", " l= et s =3D serde_json::to_string(&msg)?;", " debug!(\"=3D> {:?} {}\", = language_id, s);", " if language_id.is_none() {", " // Us= e different convention for two reasons,", " // 1. If using '\\r\= \ncontent', nvim will receive output as `\\r` + `content`, while vim", " = // receives `content`.", " // 2. Without last line endi= ng, vim output handler won't be triggered.", " write!(writer, \"= Content-Length: {}\\n\\n{}\\n\", s.len(), s)?;", " } else {", " = write!(writer, \"Content-Length: {}\\r\\n\\r\\n{}\", s.len(), s)?;",= " };", " writer.flush()?;", " }", " Ok(())", "}", "", = "#[cfg(test)]", "mod test {", " use super::RE_REMOVE_EXTRA_FIELDS;", " = use crate::types::RawMessage;", "", " #[test]", " // The library we= 're using for json-rpc doesn't accept extra fields in the structs used to",= " // deserialize the message. Sorbet (and possibly other servers) sends= an extra field in it, so", " // the client fails to deserialize that re= sponse.", " // Our previous solution was to pin the dependency to jsonrp= c-core to version 12, but is", " // suboptimal, so we now try to remove = the extra fields we know of from the response.", " //", " // See rela= ted issue: https://github.com/autozimu/LanguageClient-neovim/issues/892", "= fn it_should_remove_extra_fields() {", " // it removes the reque= stMethod field from Sorbet", " let message =3D r#\"{\"jsonrpc\":\"2.= 0\",\"id\":1,\"requestMethod\":\"initialize\",\"result\":0}\"#;", " = let message =3D RE_REMOVE_EXTRA_FIELDS.replace(message, \"\");", " l= et result: Result =3D serde_json::from_str(&message);", " = assert!(result.is_ok());", "", " let message =3D", " = r#\"{\"jsonrpc\":\"2.0\",\"id\":1,\"requestMethod\":\"textDocument/definit= ion\",\"result\":0}\"#;", " let message =3D RE_REMOVE_EXTRA_FIELDS.r= eplace(message, \"\");", " let result: Result =3D ser= de_json::from_str(&message);", " assert!(result.is_ok());", "", " = // it removes the meta field from javascript-typescript-langserver", "= let message =3D r#\"{\"jsonrpc\":\"2.0\",\"id\":1,\"meta\":{},\"res= ult\":0}\"#;", " let message =3D RE_REMOVE_EXTRA_FIELDS.replace(mess= age, \"\");", " let result: Result =3D serde_json::fr= om_str(&message);", " assert!(result.is_ok());", " }", "}", ""]} 16:30:46 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"eval","params":["s:GetVar('LanguageClient_setOmnifunc', v:true)"]= ,"id":8} 16:30:46 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 8, "jsonrp= c": "2.0", "result": true} 16:30:46 DEBUG unnamed src/language_client.rs:108 state.text_documents./hom= e/dick/LanguageClient-neovim/src/rpcclient.rs: null =3D=3D> {"languageId":"= rust","text":"use crate::types::{Call, Id, LSError, LanguageId, RawMessage,= ToInt, ToParams, ToRpcError};\nuse anyhow::{anyhow, Result};\nuse crossbea= m::channel::{bounded, unbounded, Receiver, Sender};\nuse log::*;\nuse regex= ::Regex;\nuse serde::{de::DeserializeOwned, Serialize};\nuse std::io::Write= ;\nuse std::str::FromStr;\nuse std::{\n collections::HashMap,\n io::B= ufRead,\n sync::atomic::{AtomicU64, Ordering},\n thread,\n time::D= uration,\n};\n\nconst CONTENT_MODIFIED_ERROR_CODE: i64 =3D -32801;\n\nlazy_= static! {\n // this regex is used to remove some additional fields that = we get from some servers, namely:\n // meta, sent by javascript-typescri= pt-langserver and requestMethod, sent by Sorbet.\n static ref RE_REMOVE_= EXTRA_FIELDS: Regex =3D\n Regex::new(r#\",\\s?\"(?:meta|requestMetho= d)\":(?:\"\\w+(/\\w+)?\"|\\{\\})\"#).unwrap();\n}\n\n#[derive(Serialize)]\n= pub struct RpcClient {\n language_id: LanguageId,\n #[serde(skip_seri= alizing)]\n id: AtomicU64,\n #[serde(skip_serializing)]\n writer_t= x: Sender,\n #[serde(skip_serializing)]\n reader_tx: Send= er<(Id, Sender)>,\n pub process_id: Option,\n= }\n\nimpl RpcClient {\n #[allow(clippy::new_ret_no_self)]\n pub fn ne= w(\n language_id: LanguageId,\n reader: impl BufRead + Send += 'static,\n writer: impl Write + Send + 'static,\n process_id= : Option,\n sink: Sender,\n on_crash: impl Fn(&Lan= guageId) + Clone + Send + 'static,\n ) -> Result {\n let (r= eader_tx, reader_rx): (Sender<(Id, Sender)>, _) =3D u= nbounded();\n\n let language_id_clone =3D language_id.clone();\n = let reader_thread_name =3D format!(\"reader-{:?}\", language_id);\n = let on_crash_clone =3D on_crash.clone();\n thread::Builder::new(= )\n .name(reader_thread_name.clone())\n .spawn(move |= | {\n if let Err(err) =3D loop_read(reader, reader_rx, &sink= , &language_id_clone) {\n match err.downcast_ref::() {\n Some(err) if err.kind() =3D=3D std:= :io::ErrorKind::UnexpectedEof =3D> {\n on_crash_= clone(&language_id_clone)\n }\n = _ =3D> {}\n }\n\n error!(\"Thread = {} exited with error: {:?}\", reader_thread_name, err);\n }\= n })?;\n\n let (writer_tx, writer_rx) =3D unbounded();\n = let writer_thread_name =3D format!(\"writer-{:?}\", language_id);\n = let language_id_clone =3D language_id.clone();\n thread::Buil= der::new()\n .name(writer_thread_name.clone())\n .spa= wn(move || {\n if let Err(err) =3D loop_write(writer, &write= r_rx, &language_id_clone) {\n match err.downcast_ref::() {\n Some(err) if err.kind() =3D=3D = std::io::ErrorKind::BrokenPipe =3D> {\n on_crash= (&language_id_clone)\n }\n _ = =3D> {}\n }\n\n error!(\"Thread {} ex= ited with error: {:?}\", writer_thread_name, err);\n }\n = })?;\n\n Ok(Self {\n language_id,\n id= : AtomicU64::default(),\n process_id,\n reader_tx,\n = writer_tx,\n })\n }\n\n pub fn call(\n &self,\n method: impl AsRef,\n params: i= mpl Serialize,\n ) -> Result {\n let method =3D method.as_ref(= );\n let id =3D self.id.fetch_add(1, Ordering::SeqCst);\n let= msg =3D jsonrpc_core::MethodCall {\n jsonrpc: Some(jsonrpc_core= ::Version::V2),\n id: jsonrpc_core::Id::Num(id),\n me= thod: method.to_owned(),\n params: params.to_params()?,\n = };\n let (tx, rx) =3D bounded(1);\n self.reader_tx.send((id,= tx))?;\n self.writer_tx.send(RawMessage::MethodCall(msg))?;\n = // TODO: duration from config.\n match rx.recv_timeout(Duration::f= rom_secs(60))? {\n jsonrpc_core::Output::Success(ok) =3D> Ok(ser= de_json::from_value(ok.result)?),\n // NOTE: Errors with code -3= 2801 correspond to the protocol's ContentModified error,\n // wh= ich we don't want to show to the user and should ignore, as the result of t= he\n // request that triggered this error has been invalidated b= y changes to the state\n // of the server, so we must handle thi= s error specifically.\n jsonrpc_core::Output::Failure(err)\n = if err.error.code.code() =3D=3D CONTENT_MODIFIED_ERROR_CODE =3D= >\n {\n Err(anyhow::Error::from(LSError::ContentM= odified))\n }\n jsonrpc_core::Output::Failure(err) = =3D> Err(anyhow!(\"Error: {:?}\", err)),\n }\n }\n\n pub fn no= tify(&self, method: impl AsRef, params: impl Serialize) -> Result<()> = {\n let method =3D method.as_ref();\n\n let msg =3D jsonrpc_c= ore::Notification {\n jsonrpc: Some(jsonrpc_core::Version::V2),\= n method: method.to_owned(),\n params: params.to_para= ms()?,\n };\n self.writer_tx.send(RawMessage::Notification(ms= g))?;\n Ok(())\n }\n\n pub fn output(&self, id: Id, result: Re= sult) -> Result<()> {\n let output =3D match result = {\n Ok(ok) =3D> jsonrpc_core::Output::Success(jsonrpc_core::Succ= ess {\n jsonrpc: Some(jsonrpc_core::Version::V2),\n = id: jsonrpc_core::Id::Num(id),\n result: serde_json::= to_value(ok)?,\n }),\n Err(err) =3D> jsonrpc_core::Ou= tput::Failure(jsonrpc_core::Failure {\n jsonrpc: Some(jsonrp= c_core::Version::V2),\n id: jsonrpc_core::Id::Num(id),\n = error: err.to_rpc_error(),\n }),\n };\n\n = self.writer_tx.send(RawMessage::Output(output))?;\n Ok(())\n = }\n}\n\nfn loop_read(\n reader: impl BufRead,\n reader_rx: Receiver<(= Id, Sender)>,\n sink: &Sender,\n language= _id: &LanguageId,\n) -> Result<()> {\n let mut pending_outputs =3D HashM= ap::new();\n\n // Count how many consequent empty lines.\n let mut co= unt_empty_lines =3D 0;\n\n let mut reader =3D reader;\n let mut conte= nt_length =3D 0;\n loop {\n let mut message =3D String::new();\n = let mut line =3D String::new();\n if language_id.is_some() {\= n reader.read_line(&mut line)?;\n let line =3D line.t= rim();\n if line.is_empty() {\n count_empty_lines= +=3D 1;\n if count_empty_lines > 5 {\n r= eturn Err(anyhow!(\"Unable to read from language server\"));\n = }\n\n let mut buf =3D vec![0; content_length];\n = reader.read_exact(buf.as_mut_slice())?;\n message =3D= String::from_utf8(buf)?;\n } else {\n count_empt= y_lines =3D 0;\n if !line.starts_with(\"Content-Length\") {\= n continue;\n }\n\n let to= kens: Vec<&str> =3D line.splitn(2, ':').collect();\n let len= =3D tokens\n .get(1)\n .ok_or_else(|= | anyhow!(\"Failed to get length! tokens: {:?}\", tokens))?\n = .trim();\n content_length =3D usize::from_str(len)?;\n= }\n } else if reader.read_line(&mut message)? =3D=3D 0 {= \n break;\n }\n\n let message =3D message.trim();\= n if message.is_empty() {\n continue;\n }\n = debug!(\"<=3D {:?} {}\", language_id, message);\n // FIXME: Remove = extra `meta` property from javascript-typescript-langserver and\n //= `requestMethod` sent by Sorbet.\n let s =3D RE_REMOVE_EXTRA_FIELDS.= replace(message, \"\");\n let message =3D serde_json::from_str(&s);\= n if let Err(ref err) =3D message {\n error!(\n = \"Failed to deserialize output: {}\\n\\n Message: {}\\n\\nError: {:?}= \",\n err, s, err\n );\n continue;\n = }\n // TODO: cleanup.\n let message =3D message.unwrap(= );\n match message {\n RawMessage::MethodCall(method_call= ) =3D> {\n sink.send(Call::MethodCall(language_id.clone(), m= ethod_call))?;\n }\n RawMessage::Notification(notific= ation) =3D> {\n sink.send(Call::Notification(language_id.clo= ne(), notification))?;\n }\n RawMessage::Output(outpu= t) =3D> {\n while let Ok((id, tx)) =3D reader_rx.try_recv() = {\n pending_outputs.insert(id, tx);\n }\n= \n if let Some(tx) =3D pending_outputs.remove(&output.id().t= o_int()?) {\n tx.send(output)\n .= map_err(|output| anyhow!(\"Failed to send output: {:?}\", output))?;\n = }\n }\n };\n }\n\n info!(\"reader-{:?} t= erminated\", language_id);\n Ok(())\n}\n\nfn loop_write(\n writer: im= pl Write,\n rx: &Receiver,\n language_id: &LanguageId,\n)= -> Result<()> {\n let mut writer =3D writer;\n\n for msg in rx.iter(= ) {\n let s =3D serde_json::to_string(&msg)?;\n debug!(\"=3D>= {:?} {}\", language_id, s);\n if language_id.is_none() {\n = // Use different convention for two reasons,\n // 1. If using= '\\r\\ncontent', nvim will receive output as `\\r` + `content`, while vim\= n // receives `content`.\n // 2. Without last line en= ding, vim output handler won't be triggered.\n write!(writer, \"= Content-Length: {}\\n\\n{}\\n\", s.len(), s)?;\n } else {\n = write!(writer, \"Content-Length: {}\\r\\n\\r\\n{}\", s.len(), s)?;\n = };\n writer.flush()?;\n }\n Ok(())\n}\n\n#[cfg(test)]\nmod= test {\n use super::RE_REMOVE_EXTRA_FIELDS;\n use crate::types::RawM= essage;\n\n #[test]\n // The library we're using for json-rpc doesn't= accept extra fields in the structs used to\n // deserialize the message= . Sorbet (and possibly other servers) sends an extra field in it, so\n /= / the client fails to deserialize that response.\n // Our previous solut= ion was to pin the dependency to jsonrpc-core to version 12, but is\n //= suboptimal, so we now try to remove the extra fields we know of from the r= esponse.\n //\n // See related issue: https://github.com/autozimu/Lan= guageClient-neovim/issues/892\n fn it_should_remove_extra_fields() {\n = // it removes the requestMethod field from Sorbet\n let messag= e =3D r#\"{\"jsonrpc\":\"2.0\",\"id\":1,\"requestMethod\":\"initialize\",\"= result\":0}\"#;\n let message =3D RE_REMOVE_EXTRA_FIELDS.replace(mes= sage, \"\");\n let result: Result =3D serde_json::fro= m_str(&message);\n assert!(result.is_ok());\n\n let message = =3D\n r#\"{\"jsonrpc\":\"2.0\",\"id\":1,\"requestMethod\":\"text= Document/definition\",\"result\":0}\"#;\n let message =3D RE_REMOVE_= EXTRA_FIELDS.replace(message, \"\");\n let result: Result =3D serde_json::from_str(&message);\n assert!(result.is_ok());\= n\n // it removes the meta field from javascript-typescript-langserv= er\n let message =3D r#\"{\"jsonrpc\":\"2.0\",\"id\":1,\"meta\":{},\= "result\":0}\"#;\n let message =3D RE_REMOVE_EXTRA_FIELDS.replace(me= ssage, \"\");\n let result: Result =3D serde_json::fr= om_str(&message);\n assert!(result.is_ok());\n }\n}\n","uri":"fil= e:///home/dick/LanguageClient-neovim/src/rpcclient.rs","version":0} 16:30:46 INFO unnamed src/language_server_protocol.rs:1888 text_document_co= de_lens; params=3DObject({"bufnr": Number(1), "filename": String("/home/dic= k/LanguageClient-neovim/src/rpcclient.rs"), "languageId": String("rust"), "= position": Object({"character": Number(0), "line": Number(0)}), "viewport":= Object({"end": Number(20), "start": Number(0)})}) 16:30:46 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:command","params":["setlocal omnifunc=3DLanguageClient#complete= "]} 16:30:46 DEBUG writer-Some("rust") src/rpcclient.rs:254 =3D> Some("rust") {= "jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"= languageId":"rust","text":"use crate::types::{Call, Id, LSError, LanguageId= , RawMessage, ToInt, ToParams, ToRpcError};\nuse anyhow::{anyhow, Result};\= nuse crossbeam::channel::{bounded, unbounded, Receiver, Sender};\nuse log::= *;\nuse regex::Regex;\nuse serde::{de::DeserializeOwned, Serialize};\nuse s= td::io::Write;\nuse std::str::FromStr;\nuse std::{\n collections::HashMa= p,\n io::BufRead,\n sync::atomic::{AtomicU64, Ordering},\n thread,= \n time::Duration,\n};\n\nconst CONTENT_MODIFIED_ERROR_CODE: i64 =3D -32= 801;\n\nlazy_static! {\n // this regex is used to remove some additional= fields that we get from some servers, namely:\n // meta, sent by javasc= ript-typescript-langserver and requestMethod, sent by Sorbet.\n static r= ef RE_REMOVE_EXTRA_FIELDS: Regex =3D\n Regex::new(r#\",\\s?\"(?:meta= |requestMethod)\":(?:\"\\w+(/\\w+)?\"|\\{\\})\"#).unwrap();\n}\n\n#[derive(= Serialize)]\npub struct RpcClient {\n language_id: LanguageId,\n #[se= rde(skip_serializing)]\n id: AtomicU64,\n #[serde(skip_serializing)]\= n writer_tx: Sender,\n #[serde(skip_serializing)]\n re= ader_tx: Sender<(Id, Sender)>,\n pub process_id: O= ption,\n}\n\nimpl RpcClient {\n #[allow(clippy::new_ret_no_self)]\n= pub fn new(\n language_id: LanguageId,\n reader: impl Buf= Read + Send + 'static,\n writer: impl Write + Send + 'static,\n = process_id: Option,\n sink: Sender,\n on_crash:= impl Fn(&LanguageId) + Clone + Send + 'static,\n ) -> Result {\n = let (reader_tx, reader_rx): (Sender<(Id, Sender)>, _) =3D unbounded();\n\n let language_id_clone =3D language_id.c= lone();\n let reader_thread_name =3D format!(\"reader-{:?}\", langua= ge_id);\n let on_crash_clone =3D on_crash.clone();\n thread::= Builder::new()\n .name(reader_thread_name.clone())\n = .spawn(move || {\n if let Err(err) =3D loop_read(reader, rea= der_rx, &sink, &language_id_clone) {\n match err.downcas= t_ref::() {\n Some(err) if err.kind(= ) =3D=3D std::io::ErrorKind::UnexpectedEof =3D> {\n = on_crash_clone(&language_id_clone)\n }\n = _ =3D> {}\n }\n\n err= or!(\"Thread {} exited with error: {:?}\", reader_thread_name, err);\n = }\n })?;\n\n let (writer_tx, writer_rx) =3D un= bounded();\n let writer_thread_name =3D format!(\"writer-{:?}\", lan= guage_id);\n let language_id_clone =3D language_id.clone();\n = thread::Builder::new()\n .name(writer_thread_name.clone())\n = .spawn(move || {\n if let Err(err) =3D loop_write(w= riter, &writer_rx, &language_id_clone) {\n match err.dow= ncast_ref::() {\n Some(err) if err.k= ind() =3D=3D std::io::ErrorKind::BrokenPipe =3D> {\n = on_crash(&language_id_clone)\n }\n = _ =3D> {}\n }\n\n error!(\= "Thread {} exited with error: {:?}\", writer_thread_name, err);\n = }\n })?;\n\n Ok(Self {\n language_id,\n = id: AtomicU64::default(),\n process_id,\n = reader_tx,\n writer_tx,\n })\n }\n\n pub fn call(\n &self,\n method: impl AsRef,\n = params: impl Serialize,\n ) -> Result {\n let method =3D m= ethod.as_ref();\n let id =3D self.id.fetch_add(1, Ordering::SeqCst);= \n let msg =3D jsonrpc_core::MethodCall {\n jsonrpc: Some= (jsonrpc_core::Version::V2),\n id: jsonrpc_core::Id::Num(id),\n = method: method.to_owned(),\n params: params.to_params= ()?,\n };\n let (tx, rx) =3D bounded(1);\n self.reader= _tx.send((id, tx))?;\n self.writer_tx.send(RawMessage::MethodCall(ms= g))?;\n // TODO: duration from config.\n match rx.recv_timeou= t(Duration::from_secs(60))? {\n jsonrpc_core::Output::Success(ok= ) =3D> Ok(serde_json::from_value(ok.result)?),\n // NOTE: Errors= with code -32801 correspond to the protocol's ContentModified error,\n = // which we don't want to show to the user and should ignore, as th= e result of the\n // request that triggered this error has been = invalidated by changes to the state\n // of the server, so we mu= st handle this error specifically.\n jsonrpc_core::Output::Failu= re(err)\n if err.error.code.code() =3D=3D CONTENT_MODIFIED_E= RROR_CODE =3D>\n {\n Err(anyhow::Error::from(LSEr= ror::ContentModified))\n }\n jsonrpc_core::Output::Fa= ilure(err) =3D> Err(anyhow!(\"Error: {:?}\", err)),\n }\n }\n\n = pub fn notify(&self, method: impl AsRef, params: impl Serialize) -> = Result<()> {\n let method =3D method.as_ref();\n\n let msg = =3D jsonrpc_core::Notification {\n jsonrpc: Some(jsonrpc_core::V= ersion::V2),\n method: method.to_owned(),\n params: p= arams.to_params()?,\n };\n self.writer_tx.send(RawMessage::No= tification(msg))?;\n Ok(())\n }\n\n pub fn output(&self, id: I= d, result: Result) -> Result<()> {\n let output =3D = match result {\n Ok(ok) =3D> jsonrpc_core::Output::Success(jsonr= pc_core::Success {\n jsonrpc: Some(jsonrpc_core::Version::V2= ),\n id: jsonrpc_core::Id::Num(id),\n result:= serde_json::to_value(ok)?,\n }),\n Err(err) =3D> jso= nrpc_core::Output::Failure(jsonrpc_core::Failure {\n jsonrpc= : Some(jsonrpc_core::Version::V2),\n id: jsonrpc_core::Id::N= um(id),\n error: err.to_rpc_error(),\n }),\n = };\n\n self.writer_tx.send(RawMessage::Output(output))?;\n = Ok(())\n }\n}\n\nfn loop_read(\n reader: impl BufRead,\n reader_r= x: Receiver<(Id, Sender)>,\n sink: &Sender,\= n language_id: &LanguageId,\n) -> Result<()> {\n let mut pending_outp= uts =3D HashMap::new();\n\n // Count how many consequent empty lines.\n = let mut count_empty_lines =3D 0;\n\n let mut reader =3D reader;\n = let mut content_length =3D 0;\n loop {\n let mut message =3D Stri= ng::new();\n let mut line =3D String::new();\n if language_id= .is_some() {\n reader.read_line(&mut line)?;\n let li= ne =3D line.trim();\n if line.is_empty() {\n coun= t_empty_lines +=3D 1;\n if count_empty_lines > 5 {\n = return Err(anyhow!(\"Unable to read from language server\"));\n= }\n\n let mut buf =3D vec![0; content_length= ];\n reader.read_exact(buf.as_mut_slice())?;\n = message =3D String::from_utf8(buf)?;\n } else {\n = count_empty_lines =3D 0;\n if !line.starts_with(\"Content= -Length\") {\n continue;\n }\n\n = let tokens: Vec<&str> =3D line.splitn(2, ':').collect();\n = let len =3D tokens\n .get(1)\n = .ok_or_else(|| anyhow!(\"Failed to get length! tokens: {:?}\", tokens))?\n = .trim();\n content_length =3D usize::from= _str(len)?;\n }\n } else if reader.read_line(&mut message= )? =3D=3D 0 {\n break;\n }\n\n let message =3D mes= sage.trim();\n if message.is_empty() {\n continue;\n = }\n debug!(\"<=3D {:?} {}\", language_id, message);\n // F= IXME: Remove extra `meta` property from javascript-typescript-langserver an= d\n // `requestMethod` sent by Sorbet.\n let s =3D RE_REMOVE_= EXTRA_FIELDS.replace(message, \"\");\n let message =3D serde_json::f= rom_str(&s);\n if let Err(ref err) =3D message {\n error!= (\n \"Failed to deserialize output: {}\\n\\n Message: {}\\n\= \nError: {:?}\",\n err, s, err\n );\n = continue;\n }\n // TODO: cleanup.\n let message =3D me= ssage.unwrap();\n match message {\n RawMessage::MethodCal= l(method_call) =3D> {\n sink.send(Call::MethodCall(language_= id.clone(), method_call))?;\n }\n RawMessage::Notific= ation(notification) =3D> {\n sink.send(Call::Notification(la= nguage_id.clone(), notification))?;\n }\n RawMessage:= :Output(output) =3D> {\n while let Ok((id, tx)) =3D reader_r= x.try_recv() {\n pending_outputs.insert(id, tx);\n = }\n\n if let Some(tx) =3D pending_outputs.remove(&= output.id().to_int()?) {\n tx.send(output)\n = .map_err(|output| anyhow!(\"Failed to send output: {:?}\", outp= ut))?;\n }\n }\n };\n }\n\n info!(\"= reader-{:?} terminated\", language_id);\n Ok(())\n}\n\nfn loop_write(\n = writer: impl Write,\n rx: &Receiver,\n language_id: &L= anguageId,\n) -> Result<()> {\n let mut writer =3D writer;\n\n for ms= g in rx.iter() {\n let s =3D serde_json::to_string(&msg)?;\n = debug!(\"=3D> {:?} {}\", language_id, s);\n if language_id.is_none()= {\n // Use different convention for two reasons,\n /= / 1. If using '\\r\\ncontent', nvim will receive output as `\\r` + `content= `, while vim\n // receives `content`.\n // 2. Without= last line ending, vim output handler won't be triggered.\n writ= e!(writer, \"Content-Length: {}\\n\\n{}\\n\", s.len(), s)?;\n } else= {\n write!(writer, \"Content-Length: {}\\r\\n\\r\\n{}\", s.len(= ), s)?;\n };\n writer.flush()?;\n }\n Ok(())\n}\n\n#[cf= g(test)]\nmod test {\n use super::RE_REMOVE_EXTRA_FIELDS;\n use crate= ::types::RawMessage;\n\n #[test]\n // The library we're using for jso= n-rpc doesn't accept extra fields in the structs used to\n // deserializ= e the message. Sorbet (and possibly other servers) sends an extra field in = it, so\n // the client fails to deserialize that response.\n // Our p= revious solution was to pin the dependency to jsonrpc-core to version 12, b= ut is\n // suboptimal, so we now try to remove the extra fields we know = of from the response.\n //\n // See related issue: https://github.com= /autozimu/LanguageClient-neovim/issues/892\n fn it_should_remove_extra_f= ields() {\n // it removes the requestMethod field from Sorbet\n = let message =3D r#\"{\"jsonrpc\":\"2.0\",\"id\":1,\"requestMethod\":\"in= itialize\",\"result\":0}\"#;\n let message =3D RE_REMOVE_EXTRA_FIELD= S.replace(message, \"\");\n let result: Result =3D se= rde_json::from_str(&message);\n assert!(result.is_ok());\n\n = let message =3D\n r#\"{\"jsonrpc\":\"2.0\",\"id\":1,\"requestMet= hod\":\"textDocument/definition\",\"result\":0}\"#;\n let message = =3D RE_REMOVE_EXTRA_FIELDS.replace(message, \"\");\n let result: Res= ult =3D serde_json::from_str(&message);\n assert!(res= ult.is_ok());\n\n // it removes the meta field from javascript-types= cript-langserver\n let message =3D r#\"{\"jsonrpc\":\"2.0\",\"id\":1= ,\"meta\":{},\"result\":0}\"#;\n let message =3D RE_REMOVE_EXTRA_FIE= LDS.replace(message, \"\");\n let result: Result =3D = serde_json::from_str(&message);\n assert!(result.is_ok());\n }\n}= \n","uri":"file:///home/dick/LanguageClient-neovim/src/rpcclient.rs","versi= on":0}}} 16:30:46 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"setbufvar","params":["/home/dick/LanguageClient-neovim/src/rpccli= ent.rs","LanguageClient_projectRoot","/home/dick/LanguageClient-neovim"]} 16:30:46 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:ExecuteAutocmd","params":["LanguageClientTextDocumentDidOpenPos= t"]} 16:30:46 DEBUG writer-Some("rust") src/rpcclient.rs:254 =3D> Some("rust") {= "jsonrpc":"2.0","method":"textDocument/codeLens","params":{"textDocument":{= "uri":"file:///home/dick/LanguageClient-neovim/src/rpcclient.rs"}},"id":1} 16:30:46 DEBUG reader-Some("rust") src/rpcclient.rs:207 <=3D Some("rust") {= "jsonrpc":"2.0","id":1,"error":{"code":-32801,"message":"waiting for cargo = metadata or cargo check"}} 16:30:47 DEBUG reader-Some("rust") src/rpcclient.rs:207 <=3D Some("rust") {= "jsonrpc":"2.0","id":1,"method":"client/registerCapability","params":{"regi= strations":[{"id":"workspace/didChangeWatchedFiles","method":"workspace/did= ChangeWatchedFiles","registerOptions":{"watchers":[{"globPattern":"/home/di= ck/LanguageClient-neovim/**/*.rs"},{"globPattern":"/home/dick/LanguageClien= t-neovim/**/Cargo.toml"},{"globPattern":"/home/dick/LanguageClient-neovim/*= */Cargo.lock"}]}}]}} 16:30:47 INFO unnamed src/language_server_protocol.rs:2489 client_register_= capability; language_id=3D"rust" params=3DObject({"registrations": Array([O= bject({"id": String("workspace/didChangeWatchedFiles"), "method": String("w= orkspace/didChangeWatchedFiles"), "registerOptions": Object({"watchers": Ar= ray([Object({"globPattern": String("/home/dick/LanguageClient-neovim/**/*.r= s")}), Object({"globPattern": String("/home/dick/LanguageClient-neovim/**/C= argo.toml")}), Object({"globPattern": String("/home/dick/LanguageClient-neo= vim/**/Cargo.lock")})])})})])}) 16:30:47 INFO unnamed src/language_server_protocol.rs:2512 Watching glob pa= ttern: /home/dick/LanguageClient-neovim/**/*.rs 16:30:47 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/config/mod.rs" 16:30:47 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/config/server_command.rs" 16:30:47 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/extensions/clangd.rs" 16:30:47 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/extensions/gopls.rs" 16:30:47 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/extensions/java.rs" 16:30:47 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/extensions/mod.rs" 16:30:47 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/extensions/rust_analyzer.rs" 16:30:47 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/language_client.rs" 16:30:47 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/language_server_protocol.rs" 16:30:47 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/logger.rs" 16:30:47 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/main.rs" 16:30:47 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/rpcclient.rs" 16:30:47 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/rpchandler.rs" 16:30:47 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/sign.rs" 16:30:47 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/types.rs" 16:30:47 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/utils.rs" 16:30:47 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/viewport.rs" 16:30:47 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/vim.rs" 16:30:47 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/vimext.rs" 16:30:47 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/watcher.rs" 16:30:47 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/target/debug/build/anyhow-be1327a37b4= de4c6/out/probe.rs" 16:30:47 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/target/debug/build/anyhow-fa158a1d365= cbdd8/out/probe.rs" 16:30:47 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/target/release/build/anyhow-4457d73fa= 8da0d46/out/probe.rs" 16:30:47 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/target/release/build/anyhow-7418c11d7= db55b23/out/probe.rs" 16:30:47 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/target/rls/debug/build/anyhow-be1327a= 37b4de4c6/out/probe.rs" 16:30:47 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/tests/data/sample-rs/src/libs.rs" 16:30:47 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/tests/data/sample-rs/src/main.rs" 16:30:47 INFO unnamed src/language_server_protocol.rs:2512 Watching glob pa= ttern: /home/dick/LanguageClient-neovim/**/Cargo.toml 16:30:47 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/Cargo.toml" 16:30:47 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/tests/data/sample-rs/Cargo.toml" 16:30:47 INFO unnamed src/language_server_protocol.rs:2512 Watching glob pa= ttern: /home/dick/LanguageClient-neovim/**/Cargo.lock 16:30:47 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/Cargo.lock" 16:30:47 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/tests/data/sample-rs/Cargo.lock" 16:30:47 DEBUG unnamed src/language_client.rs:108 state.registrations: [] = =3D=3D> [{"id":"workspace/didChangeWatchedFiles","method":"workspace/didCha= ngeWatchedFiles","registerOptions":{"watchers":[{"globPattern":"/home/dick/= LanguageClient-neovim/**/*.rs"},{"globPattern":"/home/dick/LanguageClient-n= eovim/**/Cargo.toml"},{"globPattern":"/home/dick/LanguageClient-neovim/**/C= argo.lock"}]}}] 16:30:47 DEBUG writer-Some("rust") src/rpcclient.rs:254 =3D> Some("rust") {= "jsonrpc":"2.0","result":null,"id":1} 16:30:48 DEBUG reader-Some("rust") src/rpcclient.rs:207 <=3D Some("rust") {= "jsonrpc":"2.0","id":2,"method":"client/registerCapability","params":{"regi= strations":[{"id":"workspace/didChangeWatchedFiles","method":"workspace/did= ChangeWatchedFiles","registerOptions":{"watchers":[{"globPattern":"/home/di= ck/LanguageClient-neovim/**/*.rs"},{"globPattern":"/home/dick/LanguageClien= t-neovim/**/Cargo.toml"},{"globPattern":"/home/dick/LanguageClient-neovim/*= */Cargo.lock"}]}}]}} 16:30:48 INFO unnamed src/language_server_protocol.rs:2489 client_register_= capability; language_id=3D"rust" params=3DObject({"registrations": Array([O= bject({"id": String("workspace/didChangeWatchedFiles"), "method": String("w= orkspace/didChangeWatchedFiles"), "registerOptions": Object({"watchers": Ar= ray([Object({"globPattern": String("/home/dick/LanguageClient-neovim/**/*.r= s")}), Object({"globPattern": String("/home/dick/LanguageClient-neovim/**/C= argo.toml")}), Object({"globPattern": String("/home/dick/LanguageClient-neo= vim/**/Cargo.lock")})])})})])}) 16:30:48 INFO unnamed src/language_server_protocol.rs:2512 Watching glob pa= ttern: /home/dick/LanguageClient-neovim/**/*.rs 16:30:48 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/config/mod.rs" 16:30:48 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/config/server_command.rs" 16:30:48 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/extensions/clangd.rs" 16:30:48 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/extensions/gopls.rs" 16:30:48 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/extensions/java.rs" 16:30:48 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/extensions/mod.rs" 16:30:48 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/extensions/rust_analyzer.rs" 16:30:48 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/language_client.rs" 16:30:48 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/language_server_protocol.rs" 16:30:48 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/logger.rs" 16:30:48 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/main.rs" 16:30:48 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/rpcclient.rs" 16:30:48 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/rpchandler.rs" 16:30:48 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/sign.rs" 16:30:48 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/types.rs" 16:30:48 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/utils.rs" 16:30:48 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/viewport.rs" 16:30:48 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/vim.rs" 16:30:48 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/vimext.rs" 16:30:48 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/src/watcher.rs" 16:30:48 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/target/debug/build/anyhow-be1327a37b4= de4c6/out/probe.rs" 16:30:48 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/target/debug/build/anyhow-fa158a1d365= cbdd8/out/probe.rs" 16:30:48 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/target/release/build/anyhow-4457d73fa= 8da0d46/out/probe.rs" 16:30:48 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/target/release/build/anyhow-7418c11d7= db55b23/out/probe.rs" 16:30:48 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/target/rls/debug/build/anyhow-be1327a= 37b4de4c6/out/probe.rs" 16:30:48 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/tests/data/sample-rs/src/libs.rs" 16:30:48 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/tests/data/sample-rs/src/main.rs" 16:30:48 INFO unnamed src/language_server_protocol.rs:2512 Watching glob pa= ttern: /home/dick/LanguageClient-neovim/**/Cargo.toml 16:30:48 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/Cargo.toml" 16:30:48 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/tests/data/sample-rs/Cargo.toml" 16:30:48 INFO unnamed src/language_server_protocol.rs:2512 Watching glob pa= ttern: /home/dick/LanguageClient-neovim/**/Cargo.lock 16:30:48 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/Cargo.lock" 16:30:48 INFO unnamed src/language_server_protocol.rs:2524 Start watching p= ath "/home/dick/LanguageClient-neovim/tests/data/sample-rs/Cargo.lock" 16:30:48 DEBUG unnamed src/language_client.rs:108 state.registrations: [{"i= d":"workspace/didChangeWatchedFiles","method":"workspace/didChangeWatchedFi= les","registerOptions":{"watchers":[{"globPattern":"/home/dick/LanguageClie= nt-neovim/**/*.rs"},{"globPattern":"/home/dick/LanguageClient-neovim/**/Car= go.toml"},{"globPattern":"/home/dick/LanguageClient-neovim/**/Cargo.lock"}]= }}] =3D=3D> [{"id":"workspace/didChangeWatchedFiles","method":"workspace/di= dChangeWatchedFiles","registerOptions":{"watchers":[{"globPattern":"/home/d= ick/LanguageClient-neovim/**/*.rs"},{"globPattern":"/home/dick/LanguageClie= nt-neovim/**/Cargo.toml"},{"globPattern":"/home/dick/LanguageClient-neovim/= **/Cargo.lock"}]}},{"id":"workspace/didChangeWatchedFiles","method":"worksp= ace/didChangeWatchedFiles","registerOptions":{"watchers":[{"globPattern":"/= home/dick/LanguageClient-neovim/**/*.rs"},{"globPattern":"/home/dick/Langua= geClient-neovim/**/Cargo.toml"},{"globPattern":"/home/dick/LanguageClient-n= eovim/**/Cargo.lock"}]}}] 16:30:48 DEBUG writer-Some("rust") src/rpcclient.rs:254 =3D> Some("rust") {= "jsonrpc":"2.0","result":null,"id":2} 16:31:04 DEBUG reader-Some("rust") src/rpcclient.rs:207 <=3D Some("rust") {= "jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":= "file:///home/dick/LanguageClient-neovim/src/rpcclient.rs","diagnostics":[]= ,"version":0}} 16:31:04 INFO unnamed src/language_server_protocol.rs:2095 text_document_pu= blish_diagnostics; params=3DObject({"diagnostics": Array([]), "uri": String= ("file:///home/dick/LanguageClient-neovim/src/rpcclient.rs"), "version": Nu= mber(0)}) 16:31:04 DEBUG unnamed src/language_client.rs:108 state.diagnostics./home/d= ick/LanguageClient-neovim/src/rpcclient.rs: null =3D=3D> [] 16:31:04 INFO unnamed src/vim.rs:225 Begin setqflist 16:31:04 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"setqflist","params":[[],"r"]} 16:31:04 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"setqflist","params":[[],"a",{"title":"[LC]: diagnostics"}]} 16:31:04 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"eval","params":["bufnr('/home/dick/LanguageClient-neovim/src/rpcc= lient.rs')"],"id":9} 16:31:04 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 9, "jsonrp= c": "2.0", "result": 1} 16:31:04 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"setbufvar","params":["/home/dick/LanguageClient-neovim/src/rpccli= ent.rs","LanguageClient_statusLineDiagnosticsCounts",{"E":0,"H":0,"I":0,"W"= :0}]} 16:31:04 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"eval","params":["LSP#filename()"],"id":10} 16:31:04 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 10, "jsonr= pc": "2.0", "result": "/home/dick/LanguageClient-neovim/src/rpcclient.rs"} 16:31:04 DEBUG unnamed src/language_client.rs:108 state.highlights./home/di= ck/LanguageClient-neovim/src/rpcclient.rs: null =3D=3D> [] 16:31:04 INFO unnamed src/language_server_protocol.rs:2873 handle_cursor_mo= ved; params=3DNull force_redraw=3Dtrue 16:31:04 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"eval","params":["LSP#filename()"],"id":11} 16:31:04 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 11, "jsonr= pc": "2.0", "result": "/home/dick/LanguageClient-neovim/src/rpcclient.rs"} 16:31:04 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"getbufvar","params":["/home/dick/LanguageClient-neovim/src/rpccli= ent.rs","&filetype"],"id":12} 16:31:04 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 12, "jsonr= pc": "2.0", "result": "rust"} 16:31:04 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"eval","params":["LSP#position()"],"id":13} 16:31:04 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 13, "jsonr= pc": "2.0", "result": {"character": 0, "line": 0}} 16:31:04 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"eval","params":["LSP#viewport()"],"id":14} 16:31:04 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 14, "jsonr= pc": "2.0", "result": {"end": 20, "start": 0}} 16:31:04 INFO unnamed src/language_server_protocol.rs:2847 get_signs_to_dis= play; filename=3D"/home/dick/LanguageClient-neovim/src/rpcclient.rs" viewpo= rt=3DViewport { start: 0, end: 20 } 16:31:04 DEBUG unnamed src/language_client.rs:108 state.viewports./home/dic= k/LanguageClient-neovim/src/rpcclient.rs: null =3D=3D> {"end":20,"start":0} 16:31:04 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:set_signs","params":["/home/dick/LanguageClient-neovim/src/rpcc= lient.rs",[]],"id":15} 16:31:04 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 15, "jsonr= pc": "2.0", "result": 0} 16:31:04 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:ClearHighlights","params":["__LCN_DIAGNOSTIC_HIGHLIGHT__"]} 16:31:04 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"eval","params":["LSP#filename()"],"id":16} 16:31:04 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 16, "jsonr= pc": "2.0", "result": "/home/dick/LanguageClient-neovim/src/rpcclient.rs"} 16:31:04 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"eval","params":["LSP#viewport()"],"id":17} 16:31:04 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 17, "jsonr= pc": "2.0", "result": {"end": 20, "start": 0}} 16:31:04 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"eval","params":["bufnr('/home/dick/LanguageClient-neovim/src/rpcc= lient.rs')"],"id":18} 16:31:04 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 18, "jsonr= pc": "2.0", "result": 1} 16:31:04 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"nvim_create_namespace","params":["LanguageClient_VirtualText"],"i= d":19} 16:31:04 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 19, "jsonr= pc": "2.0", "result": 3} 16:31:04 DEBUG unnamed src/language_client.rs:108 state.namespace_ids.Langu= ageClient_VirtualText: null =3D=3D> 3 16:31:04 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"mode","params":[],"id":20} 16:31:04 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 20, "jsonr= pc": "2.0", "result": "c"} 16:31:04 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:set_virtual_texts","params":[1,3,0,20,[]],"id":21} 16:31:04 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 21, "jsonr= pc": "2.0", "result": 0} 16:31:04 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:ExecuteAutocmd","params":["LanguageClientDiagnosticsChanged"]} 17:00:02 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "vie= wport": {"end": 20, "start": 0}, "languageId": "rust", "buftype": "", "posi= tion": {"character": 0, "line": 1}, "filename": "/home/dick/LanguageClient-= neovim/src/rpcclient.rs"}} 17:00:02 INFO unnamed src/language_server_protocol.rs:2873 handle_cursor_mo= ved; params=3DObject({"bufnr": Number(1), "buftype": String(""), "filename"= : String("/home/dick/LanguageClient-neovim/src/rpcclient.rs"), "languageId"= : String("rust"), "position": Object({"character": Number(0), "line": Numbe= r(1)}), "viewport": Object({"end": Number(20), "start": Number(0)})}) force= _redraw=3Dfalse 17:00:02 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:EchoEllipsis","params":[""]} 17:00:02 DEBUG unnamed src/language_client.rs:108 state.last_line_diagnosti= c: " " =3D=3D> "" 17:00:02 DEBUG unnamed src/language_client.rs:108 state.last_cursor_line: 0= =3D=3D> 1 17:00:03 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "vie= wport": {"end": 59, "start": 40}, "languageId": "rust", "buftype": "", "pos= ition": {"character": 24, "line": 49}, "filename": "/home/dick/LanguageClie= nt-neovim/src/rpcclient.rs"}} 17:00:03 INFO unnamed src/language_server_protocol.rs:2873 handle_cursor_mo= ved; params=3DObject({"bufnr": Number(1), "buftype": String(""), "filename"= : String("/home/dick/LanguageClient-neovim/src/rpcclient.rs"), "languageId"= : String("rust"), "position": Object({"character": Number(24), "line": Numb= er(49)}), "viewport": Object({"end": Number(59), "start": Number(40)})}) fo= rce_redraw=3Dfalse 17:00:03 DEBUG unnamed src/language_client.rs:108 state.last_cursor_line: 1= =3D=3D> 49 17:00:03 INFO unnamed src/language_server_protocol.rs:2847 get_signs_to_dis= play; filename=3D"/home/dick/LanguageClient-neovim/src/rpcclient.rs" viewpo= rt=3DViewport { start: 40, end: 59 } 17:00:03 DEBUG unnamed src/language_client.rs:108 state.viewports./home/dic= k/LanguageClient-neovim/src/rpcclient.rs.start: 0 =3D=3D> 40 17:00:03 DEBUG unnamed src/language_client.rs:108 state.viewports./home/dic= k/LanguageClient-neovim/src/rpcclient.rs.end: 20 =3D=3D> 59 17:00:03 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:set_signs","params":["/home/dick/LanguageClient-neovim/src/rpcc= lient.rs",[]],"id":22} 17:00:03 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 22, "jsonr= pc": "2.0", "result": 0} 17:00:03 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:ClearHighlights","params":["__LCN_DIAGNOSTIC_HIGHLIGHT__"]} 17:00:03 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"mode","params":[],"id":23} 17:00:03 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 23, "jsonr= pc": "2.0", "result": "n"} 17:00:03 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:set_virtual_texts","params":[1,3,40,59,[]],"id":24} 17:00:03 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 24, "jsonr= pc": "2.0", "result": 0} 17:00:16 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 1, "jsonrp= c": "2.0", "method": "textDocument/definition", "params": {"bufnr": 1, "cha= racter": 45, "handle": true, "languageId": "rust", "gotoCmd": null, "line":= 49, "text": ["use crate::types::{Call, Id, LSError, LanguageId, RawMessage= , ToInt, ToParams, ToRpcError};", "use anyhow::{anyhow, Result};", "use cro= ssbeam::channel::{bounded, unbounded, Receiver, Sender};", "use log::*;", "= use regex::Regex;", "use serde::{de::DeserializeOwned, Serialize};", "use s= td::io::Write;", "use std::str::FromStr;", "use std::{", " collections::= HashMap,", " io::BufRead,", " sync::atomic::{AtomicU64, Ordering},", = " thread,", " time::Duration,", "};", "", "const CONTENT_MODIFIED_ERR= OR_CODE: i64 =3D -32801;", "", "lazy_static! {", " // this regex is used= to remove some additional fields that we get from some servers, namely:", = " // meta, sent by javascript-typescript-langserver and requestMethod, s= ent by Sorbet.", " static ref RE_REMOVE_EXTRA_FIELDS: Regex =3D", " = Regex::new(r#\",\\s?\"(?:meta|requestMethod)\":(?:\"\\w+(/\\w+)?\"|\\{\\= })\"#).unwrap();", "}", "", "#[derive(Serialize)]", "pub struct RpcClient {= ", " language_id: LanguageId,", " #[serde(skip_serializing)]", " i= d: AtomicU64,", " #[serde(skip_serializing)]", " writer_tx: Sender,", " #[serde(skip_serializing)]", " reader_tx: Sender<(Id, = Sender)>,", " pub process_id: Option,", "}", = "", "impl RpcClient {", " #[allow(clippy::new_ret_no_self)]", " pub f= n new(", " language_id: LanguageId,", " reader: impl BufRead = + Send + 'static,", " writer: impl Write + Send + 'static,", " = process_id: Option,", " sink: Sender,", " on_cra= sh: impl Fn(&LanguageId) + Clone + Send + 'static,", " ) -> Result= {", " let (reader_tx, reader_rx): (Sender<(Id, Sender)>, _) =3D unbounded();", "", " let language_id_clone =3D la= nguage_id.clone();", " let reader_thread_name =3D format!(\"reader-{= :?}\", language_id);", " let on_crash_clone =3D on_crash.clone();", = " thread::Builder::new()", " .name(reader_thread_name.clo= ne())", " .spawn(move || {", " if let Err(err) = =3D loop_read(reader, reader_rx, &sink, &language_id_clone) {", " = match err.downcast_ref::() {", " = Some(err) if err.kind() =3D=3D std::io::ErrorKind::UnexpectedEof =3D= > {", " on_crash_clone(&language_id_clone)", " = }", " _ =3D> {}", " = }", "", " error!(\"Thread {} exited with error:= {:?}\", reader_thread_name, err);", " }", " })?;= ", "", " let (writer_tx, writer_rx) =3D unbounded();", " let = writer_thread_name =3D format!(\"writer-{:?}\", language_id);", " le= t language_id_clone =3D language_id.clone();", " thread::Builder::ne= w()", " .name(writer_thread_name.clone())", " .spawn(= move || {", " if let Err(err) =3D loop_write(writer, &writer= _rx, &language_id_clone) {", " match err.downcast_ref::<= std::io::Error>() {", " Some(err) if err.kind() =3D= =3D std::io::ErrorKind::BrokenPipe =3D> {", " on= _crash(&language_id_clone)", " }", " = _ =3D> {}", " }", "", " error= !(\"Thread {} exited with error: {:?}\", writer_thread_name, err);", " = }", " })?;", "", " Ok(Self {", " la= nguage_id,", " id: AtomicU64::default(),", " process_= id,", " reader_tx,", " writer_tx,", " })", " = }", "", " pub fn call(", " &self,", " = method: impl AsRef,", " params: impl Serialize,", " ) -> = Result {", " let method =3D method.as_ref();", " let id = =3D self.id.fetch_add(1, Ordering::SeqCst);", " let msg =3D jsonrpc_= core::MethodCall {", " jsonrpc: Some(jsonrpc_core::Version::V2),= ", " id: jsonrpc_core::Id::Num(id),", " method: metho= d.to_owned(),", " params: params.to_params()?,", " };", "= let (tx, rx) =3D bounded(1);", " self.reader_tx.send((id, tx= ))?;", " self.writer_tx.send(RawMessage::MethodCall(msg))?;", " = // TODO: duration from config.", " match rx.recv_timeout(Duration= ::from_secs(60))? {", " jsonrpc_core::Output::Success(ok) =3D> O= k(serde_json::from_value(ok.result)?),", " // NOTE: Errors with = code -32801 correspond to the protocol's ContentModified error,", " = // which we don't want to show to the user and should ignore, as the re= sult of the", " // request that triggered this error has been in= validated by changes to the state", " // of the server, so we mu= st handle this error specifically.", " jsonrpc_core::Output::Fai= lure(err)", " if err.error.code.code() =3D=3D CONTENT_MODIFI= ED_ERROR_CODE =3D>", " {", " Err(anyhow::Error::f= rom(LSError::ContentModified))", " }", " jsonrpc_core= ::Output::Failure(err) =3D> Err(anyhow!(\"Error: {:?}\", err)),", " = }", " }", "", " pub fn notify(&self, method: impl AsRef, params:= impl Serialize) -> Result<()> {", " let method =3D method.as_ref();= ", "", " let msg =3D jsonrpc_core::Notification {", " jso= nrpc: Some(jsonrpc_core::Version::V2),", " method: method.to_own= ed(),", " params: params.to_params()?,", " };", " = self.writer_tx.send(RawMessage::Notification(msg))?;", " Ok(())", " = }", "", " pub fn output(&self, id: Id, result: Result= ) -> Result<()> {", " let output =3D match result {", " O= k(ok) =3D> jsonrpc_core::Output::Success(jsonrpc_core::Success {", " = jsonrpc: Some(jsonrpc_core::Version::V2),", " id: j= sonrpc_core::Id::Num(id),", " result: serde_json::to_value(o= k)?,", " }),", " Err(err) =3D> jsonrpc_core::Output::= Failure(jsonrpc_core::Failure {", " jsonrpc: Some(jsonrpc_co= re::Version::V2),", " id: jsonrpc_core::Id::Num(id),", " = error: err.to_rpc_error(),", " }),", " };", "= ", " self.writer_tx.send(RawMessage::Output(output))?;", " Ok= (())", " }", "}", "", "fn loop_read(", " reader: impl BufRead,", " = reader_rx: Receiver<(Id, Sender)>,", " sink: &Sen= der,", " language_id: &LanguageId,", ") -> Result<()> {", " let= mut pending_outputs =3D HashMap::new();", "", " // Count how many conse= quent empty lines.", " let mut count_empty_lines =3D 0;", "", " let m= ut reader =3D reader;", " let mut content_length =3D 0;", " loop {", = " let mut message =3D String::new();", " let mut line =3D Str= ing::new();", " if language_id.is_some() {", " reader.rea= d_line(&mut line)?;", " let line =3D line.trim();", " = if line.is_empty() {", " count_empty_lines +=3D 1;", " = if count_empty_lines > 5 {", " return Err(any= how!(\"Unable to read from language server\"));", " }", "", = " let mut buf =3D vec![0; content_length];", " = reader.read_exact(buf.as_mut_slice())?;", " message =3D St= ring::from_utf8(buf)?;", " } else {", " count_emp= ty_lines =3D 0;", " if !line.starts_with(\"Content-Length\")= {", " continue;", " }", "", " = let tokens: Vec<&str> =3D line.splitn(2, ':').collect();", " = let len =3D tokens", " .get(1)", " = .ok_or_else(|| anyhow!(\"Failed to get length! tokens: {:?}\", tokens))= ?", " .trim();", " content_length =3D usi= ze::from_str(len)?;", " }", " } else if reader.read_line(= &mut message)? =3D=3D 0 {", " break;", " }", "", " = let message =3D message.trim();", " if message.is_empty() {", " = continue;", " }", " debug!(\"<=3D {:?} {}\", language= _id, message);", " // FIXME: Remove extra `meta` property from javas= cript-typescript-langserver and", " // `requestMethod` sent by Sorbe= t.", " let s =3D RE_REMOVE_EXTRA_FIELDS.replace(message, \"\");", " = let message =3D serde_json::from_str(&s);", " if let Err(ref = err) =3D message {", " error!(", " \"Failed to de= serialize output: {}\\n\\n Message: {}\\n\\nError: {:?}\",", " = err, s, err", " );", " continue;", " }", " = // TODO: cleanup.", " let message =3D message.unwrap();", " = match message {", " RawMessage::MethodCall(method_call) = =3D> {", " sink.send(Call::MethodCall(language_id.clone(), m= ethod_call))?;", " }", " RawMessage::Notification(not= ification) =3D> {", " sink.send(Call::Notification(language_= id.clone(), notification))?;", " }", " RawMessage::Ou= tput(output) =3D> {", " while let Ok((id, tx)) =3D reader_rx= .try_recv() {", " pending_outputs.insert(id, tx);", " = }", "", " if let Some(tx) =3D pending_outputs.r= emove(&output.id().to_int()?) {", " tx.send(output)", " = .map_err(|output| anyhow!(\"Failed to send output: {= :?}\", output))?;", " }", " }", " };", " = }", "", " info!(\"reader-{:?} terminated\", language_id);", " Ok(()= )", "}", "", "fn loop_write(", " writer: impl Write,", " rx: &Receive= r,", " language_id: &LanguageId,", ") -> Result<()> {", " = let mut writer =3D writer;", "", " for msg in rx.iter() {", " le= t s =3D serde_json::to_string(&msg)?;", " debug!(\"=3D> {:?} {}\", l= anguage_id, s);", " if language_id.is_none() {", " // Use= different convention for two reasons,", " // 1. If using '\\r\\= ncontent', nvim will receive output as `\\r` + `content`, while vim", " = // receives `content`.", " // 2. Without last line endin= g, vim output handler won't be triggered.", " write!(writer, \"C= ontent-Length: {}\\n\\n{}\\n\", s.len(), s)?;", " } else {", " = write!(writer, \"Content-Length: {}\\r\\n\\r\\n{}\", s.len(), s)?;", = " };", " writer.flush()?;", " }", " Ok(())", "}", "", "= #[cfg(test)]", "mod test {", " use super::RE_REMOVE_EXTRA_FIELDS;", " = use crate::types::RawMessage;", "", " #[test]", " // The library we'= re using for json-rpc doesn't accept extra fields in the structs used to", = " // deserialize the message. Sorbet (and possibly other servers) sends = an extra field in it, so", " // the client fails to deserialize that res= ponse.", " // Our previous solution was to pin the dependency to jsonrpc= -core to version 12, but is", " // suboptimal, so we now try to remove t= he extra fields we know of from the response.", " //", " // See relat= ed issue: https://github.com/autozimu/LanguageClient-neovim/issues/892", " = fn it_should_remove_extra_fields() {", " // it removes the reques= tMethod field from Sorbet", " let message =3D r#\"{\"jsonrpc\":\"2.0= \",\"id\":1,\"requestMethod\":\"initialize\",\"result\":0}\"#;", " l= et message =3D RE_REMOVE_EXTRA_FIELDS.replace(message, \"\");", " le= t result: Result =3D serde_json::from_str(&message);", " = assert!(result.is_ok());", "", " let message =3D", " = r#\"{\"jsonrpc\":\"2.0\",\"id\":1,\"requestMethod\":\"textDocument/definiti= on\",\"result\":0}\"#;", " let message =3D RE_REMOVE_EXTRA_FIELDS.re= place(message, \"\");", " let result: Result =3D serd= e_json::from_str(&message);", " assert!(result.is_ok());", "", " = // it removes the meta field from javascript-typescript-langserver", " = let message =3D r#\"{\"jsonrpc\":\"2.0\",\"id\":1,\"meta\":{},\"resu= lt\":0}\"#;", " let message =3D RE_REMOVE_EXTRA_FIELDS.replace(messa= ge, \"\");", " let result: Result =3D serde_json::fro= m_str(&message);", " assert!(result.is_ok());", " }", "}", ""], "= filename": "/home/dick/LanguageClient-neovim/src/rpcclient.rs"}} 17:00:16 INFO unnamed src/language_server_protocol.rs:1473 text_document_de= finition; params=3DObject({"bufnr": Number(1), "character": Number(45), "fi= lename": String("/home/dick/LanguageClient-neovim/src/rpcclient.rs"), "goto= Cmd": Null, "handle": Bool(true), "languageId": String("rust"), "line": Num= ber(49), "text": Array([String("use crate::types::{Call, Id, LSError, Langu= ageId, RawMessage, ToInt, ToParams, ToRpcError};"), String("use anyhow::{an= yhow, Result};"), String("use crossbeam::channel::{bounded, unbounded, Rece= iver, Sender};"), String("use log::*;"), String("use regex::Regex;"), Strin= g("use serde::{de::DeserializeOwned, Serialize};"), String("use std::io::Wr= ite;"), String("use std::str::FromStr;"), String("use std::{"), String(" = collections::HashMap,"), String(" io::BufRead,"), String(" sync::ato= mic::{AtomicU64, Ordering},"), String(" thread,"), String(" time::Dur= ation,"), String("};"), String(""), String("const CONTENT_MODIFIED_ERROR_CO= DE: i64 =3D -32801;"), String(""), String("lazy_static! {"), String(" //= this regex is used to remove some additional fields that we get from some = servers, namely:"), String(" // meta, sent by javascript-typescript-lang= server and requestMethod, sent by Sorbet."), String(" static ref RE_REMO= VE_EXTRA_FIELDS: Regex =3D"), String(" Regex::new(r#\",\\s?\"(?:meta= |requestMethod)\":(?:\"\\w+(/\\w+)?\"|\\{\\})\"#).unwrap();"), String("}"),= String(""), String("#[derive(Serialize)]"), String("pub struct RpcClient {= "), String(" language_id: LanguageId,"), String(" #[serde(skip_serial= izing)]"), String(" id: AtomicU64,"), String(" #[serde(skip_serializi= ng)]"), String(" writer_tx: Sender,"), String(" #[serde(s= kip_serializing)]"), String(" reader_tx: Sender<(Id, Sender)>,"), String(" pub process_id: Option,"), String("}"), St= ring(""), String("impl RpcClient {"), String(" #[allow(clippy::new_ret_n= o_self)]"), String(" pub fn new("), String(" language_id: Languag= eId,"), String(" reader: impl BufRead + Send + 'static,"), String(" = writer: impl Write + Send + 'static,"), String(" process_id: = Option,"), String(" sink: Sender,"), String(" on_c= rash: impl Fn(&LanguageId) + Clone + Send + 'static,"), String(" ) -> Re= sult {"), String(" let (reader_tx, reader_rx): (Sender<(Id, Se= nder)>, _) =3D unbounded();"), String(""), String(" = let language_id_clone =3D language_id.clone();"), String(" let= reader_thread_name =3D format!(\"reader-{:?}\", language_id);"), String(" = let on_crash_clone =3D on_crash.clone();"), String(" thread::= Builder::new()"), String(" .name(reader_thread_name.clone())"), = String(" .spawn(move || {"), String(" if let Err(= err) =3D loop_read(reader, reader_rx, &sink, &language_id_clone) {"), Strin= g(" match err.downcast_ref::() {"), Stri= ng(" Some(err) if err.kind() =3D=3D std::io::ErrorKi= nd::UnexpectedEof =3D> {"), String(" on_crash_cl= one(&language_id_clone)"), String(" }"), String(" = _ =3D> {}"), String(" }"), String("= "), String(" error!(\"Thread {} exited with error: {:?}\= ", reader_thread_name, err);"), String(" }"), String(" = })?;"), String(""), String(" let (writer_tx, writer_rx) =3D un= bounded();"), String(" let writer_thread_name =3D format!(\"writer-{= :?}\", language_id);"), String(" let language_id_clone =3D language_= id.clone();"), String(" thread::Builder::new()"), String(" = .name(writer_thread_name.clone())"), String(" .spawn(move || {= "), String(" if let Err(err) =3D loop_write(writer, &writer_= rx, &language_id_clone) {"), String(" match err.downcast= _ref::() {"), String(" Some(err) if = err.kind() =3D=3D std::io::ErrorKind::BrokenPipe =3D> {"), String(" = on_crash(&language_id_clone)"), String(" = }"), String(" _ =3D> {}"), String(" = }"), String(""), String(" error!(\"Thread {}= exited with error: {:?}\", writer_thread_name, err);"), String(" = }"), String(" })?;"), String(""), String(" Ok(Self = {"), String(" language_id,"), String(" id: AtomicU64:= :default(),"), String(" process_id,"), String(" reade= r_tx,"), String(" writer_tx,"), String(" })"), String(" = }"), String(""), String(" pub fn call("), String(= " &self,"), String(" method: impl AsRef,"), String(" = params: impl Serialize,"), String(" ) -> Result {"), String(" = let method =3D method.as_ref();"), String(" let id =3D self.id.f= etch_add(1, Ordering::SeqCst);"), String(" let msg =3D jsonrpc_core:= :MethodCall {"), String(" jsonrpc: Some(jsonrpc_core::Version::V= 2),"), String(" id: jsonrpc_core::Id::Num(id),"), String(" = method: method.to_owned(),"), String(" params: params.to_p= arams()?,"), String(" };"), String(" let (tx, rx) =3D bounded= (1);"), String(" self.reader_tx.send((id, tx))?;"), String(" = self.writer_tx.send(RawMessage::MethodCall(msg))?;"), String(" // TO= DO: duration from config."), String(" match rx.recv_timeout(Duration= ::from_secs(60))? {"), String(" jsonrpc_core::Output::Success(ok= ) =3D> Ok(serde_json::from_value(ok.result)?),"), String(" // NO= TE: Errors with code -32801 correspond to the protocol's ContentModified er= ror,"), String(" // which we don't want to show to the user and = should ignore, as the result of the"), String(" // request that = triggered this error has been invalidated by changes to the state"), String= (" // of the server, so we must handle this error specifically."= ), String(" jsonrpc_core::Output::Failure(err)"), String(" = if err.error.code.code() =3D=3D CONTENT_MODIFIED_ERROR_CODE =3D>"= ), String(" {"), String(" Err(anyhow::Error::from= (LSError::ContentModified))"), String(" }"), String(" = jsonrpc_core::Output::Failure(err) =3D> Err(anyhow!(\"Error: {:?}\", err))= ,"), String(" }"), String(" }"), String(""), String(" pub fn n= otify(&self, method: impl AsRef, params: impl Serialize) -> Result<()>= {"), String(" let method =3D method.as_ref();"), String(""), String= (" let msg =3D jsonrpc_core::Notification {"), String(" j= sonrpc: Some(jsonrpc_core::Version::V2),"), String(" method: met= hod.to_owned(),"), String(" params: params.to_params()?,"), Stri= ng(" };"), String(" self.writer_tx.send(RawMessage::Notificat= ion(msg))?;"), String(" Ok(())"), String(" }"), String(""), Strin= g(" pub fn output(&self, id: Id, result: Result) -> Resu= lt<()> {"), String(" let output =3D match result {"), String(" = Ok(ok) =3D> jsonrpc_core::Output::Success(jsonrpc_core::Success {"), = String(" jsonrpc: Some(jsonrpc_core::Version::V2),"), String= (" id: jsonrpc_core::Id::Num(id),"), String(" = result: serde_json::to_value(ok)?,"), String(" }),"), String(" = Err(err) =3D> jsonrpc_core::Output::Failure(jsonrpc_core::Failur= e {"), String(" jsonrpc: Some(jsonrpc_core::Version::V2),"),= String(" id: jsonrpc_core::Id::Num(id),"), String(" = error: err.to_rpc_error(),"), String(" }),"), String(" = };"), String(""), String(" self.writer_tx.send(RawMessage::Out= put(output))?;"), String(" Ok(())"), String(" }"), String("}"), S= tring(""), String("fn loop_read("), String(" reader: impl BufRead,"), St= ring(" reader_rx: Receiver<(Id, Sender)>,"), Strin= g(" sink: &Sender,"), String(" language_id: &LanguageId,"), Str= ing(") -> Result<()> {"), String(" let mut pending_outputs =3D HashMap::= new();"), String(""), String(" // Count how many consequent empty lines.= "), String(" let mut count_empty_lines =3D 0;"), String(""), String(" = let mut reader =3D reader;"), String(" let mut content_length =3D 0;"),= String(" loop {"), String(" let mut message =3D String::new();")= , String(" let mut line =3D String::new();"), String(" if lan= guage_id.is_some() {"), String(" reader.read_line(&mut line)?;")= , String(" let line =3D line.trim();"), String(" if l= ine.is_empty() {"), String(" count_empty_lines +=3D 1;"), St= ring(" if count_empty_lines > 5 {"), String(" = return Err(anyhow!(\"Unable to read from language server\"));"), Strin= g(" }"), String(""), String(" let mut buf =3D= vec![0; content_length];"), String(" reader.read_exact(buf.= as_mut_slice())?;"), String(" message =3D String::from_utf8(= buf)?;"), String(" } else {"), String(" count_emp= ty_lines =3D 0;"), String(" if !line.starts_with(\"Content-L= ength\") {"), String(" continue;"), String(" = }"), String(""), String(" let tokens: Vec<&str> =3D line= .splitn(2, ':').collect();"), String(" let len =3D tokens"),= String(" .get(1)"), String(" .ok_or_= else(|| anyhow!(\"Failed to get length! tokens: {:?}\", tokens))?"), String= (" .trim();"), String(" content_length = =3D usize::from_str(len)?;"), String(" }"), String(" } el= se if reader.read_line(&mut message)? =3D=3D 0 {"), String(" bre= ak;"), String(" }"), String(""), String(" let message =3D mes= sage.trim();"), String(" if message.is_empty() {"), String(" = continue;"), String(" }"), String(" debug!(\"<=3D {:?} {}= \", language_id, message);"), String(" // FIXME: Remove extra `meta`= property from javascript-typescript-langserver and"), String(" // `= requestMethod` sent by Sorbet."), String(" let s =3D RE_REMOVE_EXTRA= _FIELDS.replace(message, \"\");"), String(" let message =3D serde_js= on::from_str(&s);"), String(" if let Err(ref err) =3D message {"), S= tring(" error!("), String(" \"Failed to deseriali= ze output: {}\\n\\n Message: {}\\n\\nError: {:?}\","), String(" = err, s, err"), String(" );"), String(" continue;"= ), String(" }"), String(" // TODO: cleanup."), String(" = let message =3D message.unwrap();"), String(" match message {"), S= tring(" RawMessage::MethodCall(method_call) =3D> {"), String(" = sink.send(Call::MethodCall(language_id.clone(), method_call))= ?;"), String(" }"), String(" RawMessage::Notification= (notification) =3D> {"), String(" sink.send(Call::Notificati= on(language_id.clone(), notification))?;"), String(" }"), String= (" RawMessage::Output(output) =3D> {"), String(" = while let Ok((id, tx)) =3D reader_rx.try_recv() {"), String(" = pending_outputs.insert(id, tx);"), String(" }"), Strin= g(""), String(" if let Some(tx) =3D pending_outputs.remove(&= output.id().to_int()?) {"), String(" tx.send(output)"), = String(" .map_err(|output| anyhow!(\"Failed to send = output: {:?}\", output))?;"), String(" }"), String(" = }"), String(" };"), String(" }"), String(""), String(" inf= o!(\"reader-{:?} terminated\", language_id);"), String(" Ok(())"), Strin= g("}"), String(""), String("fn loop_write("), String(" writer: impl Writ= e,"), String(" rx: &Receiver,"), String(" language_id: &L= anguageId,"), String(") -> Result<()> {"), String(" let mut writer =3D w= riter;"), String(""), String(" for msg in rx.iter() {"), String(" = let s =3D serde_json::to_string(&msg)?;"), String(" debug!(\"=3D> {= :?} {}\", language_id, s);"), String(" if language_id.is_none() {"),= String(" // Use different convention for two reasons,"), String= (" // 1. If using '\\r\\ncontent', nvim will receive output as `= \\r` + `content`, while vim"), String(" // receives `content`.")= , String(" // 2. Without last line ending, vim output handler wo= n't be triggered."), String(" write!(writer, \"Content-Length: {= }\\n\\n{}\\n\", s.len(), s)?;"), String(" } else {"), String(" = write!(writer, \"Content-Length: {}\\r\\n\\r\\n{}\", s.len(), s)?;"),= String(" };"), String(" writer.flush()?;"), String(" }"),= String(" Ok(())"), String("}"), String(""), String("#[cfg(test)]"), Str= ing("mod test {"), String(" use super::RE_REMOVE_EXTRA_FIELDS;"), String= (" use crate::types::RawMessage;"), String(""), String(" #[test]"), S= tring(" // The library we're using for json-rpc doesn't accept extra fie= lds in the structs used to"), String(" // deserialize the message. Sorbe= t (and possibly other servers) sends an extra field in it, so"), String(" = // the client fails to deserialize that response."), String(" // Our p= revious solution was to pin the dependency to jsonrpc-core to version 12, b= ut is"), String(" // suboptimal, so we now try to remove the extra field= s we know of from the response."), String(" //"), String(" // See rel= ated issue: https://github.com/autozimu/LanguageClient-neovim/issues/892"),= String(" fn it_should_remove_extra_fields() {"), String(" // it = removes the requestMethod field from Sorbet"), String(" let message = =3D r#\"{\"jsonrpc\":\"2.0\",\"id\":1,\"requestMethod\":\"initialize\",\"re= sult\":0}\"#;"), String(" let message =3D RE_REMOVE_EXTRA_FIELDS.rep= lace(message, \"\");"), String(" let result: Result = =3D serde_json::from_str(&message);"), String(" assert!(result.is_ok= ());"), String(""), String(" let message =3D"), String(" = r#\"{\"jsonrpc\":\"2.0\",\"id\":1,\"requestMethod\":\"textDocument/definiti= on\",\"result\":0}\"#;"), String(" let message =3D RE_REMOVE_EXTRA_F= IELDS.replace(message, \"\");"), String(" let result: Result =3D serde_json::from_str(&message);"), String(" assert!(resu= lt.is_ok());"), String(""), String(" // it removes the meta field fr= om javascript-typescript-langserver"), String(" let message =3D r#\"= {\"jsonrpc\":\"2.0\",\"id\":1,\"meta\":{},\"result\":0}\"#;"), String(" = let message =3D RE_REMOVE_EXTRA_FIELDS.replace(message, \"\");"), Strin= g(" let result: Result =3D serde_json::from_str(&mess= age);"), String(" assert!(result.is_ok());"), String(" }"), Strin= g("}"), String("")])}) 17:00:16 INFO unnamed src/language_server_protocol.rs:1077 find_locations; = params=3DObject({"bufnr": Number(1), "character": Number(45), "filename": S= tring("/home/dick/LanguageClient-neovim/src/rpcclient.rs"), "gotoCmd": Null= , "handle": Bool(true), "languageId": String("rust"), "line": Number(49), "= method": String("textDocument/definition"), "text": Array([String("use crat= e::types::{Call, Id, LSError, LanguageId, RawMessage, ToInt, ToParams, ToRp= cError};"), String("use anyhow::{anyhow, Result};"), String("use crossbeam:= :channel::{bounded, unbounded, Receiver, Sender};"), String("use log::*;"),= String("use regex::Regex;"), String("use serde::{de::DeserializeOwned, Ser= ialize};"), String("use std::io::Write;"), String("use std::str::FromStr;")= , String("use std::{"), String(" collections::HashMap,"), String(" io= ::BufRead,"), String(" sync::atomic::{AtomicU64, Ordering},"), String(" = thread,"), String(" time::Duration,"), String("};"), String(""), Stri= ng("const CONTENT_MODIFIED_ERROR_CODE: i64 =3D -32801;"), String(""), Strin= g("lazy_static! {"), String(" // this regex is used to remove some addit= ional fields that we get from some servers, namely:"), String(" // meta,= sent by javascript-typescript-langserver and requestMethod, sent by Sorbet= ."), String(" static ref RE_REMOVE_EXTRA_FIELDS: Regex =3D"), String(" = Regex::new(r#\",\\s?\"(?:meta|requestMethod)\":(?:\"\\w+(/\\w+)?\"|\\= {\\})\"#).unwrap();"), String("}"), String(""), String("#[derive(Serialize)= ]"), String("pub struct RpcClient {"), String(" language_id: LanguageId,= "), String(" #[serde(skip_serializing)]"), String(" id: AtomicU64,"),= String(" #[serde(skip_serializing)]"), String(" writer_tx: Sender,"), String(" #[serde(skip_serializing)]"), String(" reader_= tx: Sender<(Id, Sender)>,"), String(" pub process_= id: Option,"), String("}"), String(""), String("impl RpcClient {"), St= ring(" #[allow(clippy::new_ret_no_self)]"), String(" pub fn new("), S= tring(" language_id: LanguageId,"), String(" reader: impl Buf= Read + Send + 'static,"), String(" writer: impl Write + Send + 'stat= ic,"), String(" process_id: Option,"), String(" sink: Se= nder,"), String(" on_crash: impl Fn(&LanguageId) + Clone + Sen= d + 'static,"), String(" ) -> Result {"), String(" let (rea= der_tx, reader_rx): (Sender<(Id, Sender)>, _) =3D unb= ounded();"), String(""), String(" let language_id_clone =3D language= _id.clone();"), String(" let reader_thread_name =3D format!(\"reader= -{:?}\", language_id);"), String(" let on_crash_clone =3D on_crash.c= lone();"), String(" thread::Builder::new()"), String(" .n= ame(reader_thread_name.clone())"), String(" .spawn(move || {"), = String(" if let Err(err) =3D loop_read(reader, reader_rx, &s= ink, &language_id_clone) {"), String(" match err.downcas= t_ref::() {"), String(" Some(err) if= err.kind() =3D=3D std::io::ErrorKind::UnexpectedEof =3D> {"), String(" = on_crash_clone(&language_id_clone)"), String(" = }"), String(" _ =3D> {}"), String= (" }"), String(""), String(" error!(\= "Thread {} exited with error: {:?}\", reader_thread_name, err);"), String("= }"), String(" })?;"), String(""), String(" = let (writer_tx, writer_rx) =3D unbounded();"), String(" let writer= _thread_name =3D format!(\"writer-{:?}\", language_id);"), String(" = let language_id_clone =3D language_id.clone();"), String(" thread::B= uilder::new()"), String(" .name(writer_thread_name.clone())"), S= tring(" .spawn(move || {"), String(" if let Err(e= rr) =3D loop_write(writer, &writer_rx, &language_id_clone) {"), String(" = match err.downcast_ref::() {"), String(" = Some(err) if err.kind() =3D=3D std::io::ErrorKind::Br= okenPipe =3D> {"), String(" on_crash(&language_i= d_clone)"), String(" }"), String(" = _ =3D> {}"), String(" }"), String(""), String(" = error!(\"Thread {} exited with error: {:?}\", writer_threa= d_name, err);"), String(" }"), String(" })?;"), S= tring(""), String(" Ok(Self {"), String(" language_id,"),= String(" id: AtomicU64::default(),"), String(" proce= ss_id,"), String(" reader_tx,"), String(" writer_tx,"= ), String(" })"), String(" }"), String(""), String(" pub fn ca= ll("), String(" &self,"), String(" metho= d: impl AsRef,"), String(" params: impl Serialize,"), String(" = ) -> Result {"), String(" let method =3D method.as_ref();"), S= tring(" let id =3D self.id.fetch_add(1, Ordering::SeqCst);"), String= (" let msg =3D jsonrpc_core::MethodCall {"), String(" jso= nrpc: Some(jsonrpc_core::Version::V2),"), String(" id: jsonrpc_c= ore::Id::Num(id),"), String(" method: method.to_owned(),"), Stri= ng(" params: params.to_params()?,"), String(" };"), Strin= g(" let (tx, rx) =3D bounded(1);"), String(" self.reader_tx.s= end((id, tx))?;"), String(" self.writer_tx.send(RawMessage::MethodCa= ll(msg))?;"), String(" // TODO: duration from config."), String(" = match rx.recv_timeout(Duration::from_secs(60))? {"), String(" = jsonrpc_core::Output::Success(ok) =3D> Ok(serde_json::from_value(ok.resu= lt)?),"), String(" // NOTE: Errors with code -32801 correspond t= o the protocol's ContentModified error,"), String(" // which we = don't want to show to the user and should ignore, as the result of the"), S= tring(" // request that triggered this error has been invalidate= d by changes to the state"), String(" // of the server, so we mu= st handle this error specifically."), String(" jsonrpc_core::Out= put::Failure(err)"), String(" if err.error.code.code() =3D= =3D CONTENT_MODIFIED_ERROR_CODE =3D>"), String(" {"), String(" = Err(anyhow::Error::from(LSError::ContentModified))"), String(= " }"), String(" jsonrpc_core::Output::Failure(err) = =3D> Err(anyhow!(\"Error: {:?}\", err)),"), String(" }"), String(" = }"), String(""), String(" pub fn notify(&self, method: impl AsRef= , params: impl Serialize) -> Result<()> {"), String(" let method =3D= method.as_ref();"), String(""), String(" let msg =3D jsonrpc_core::= Notification {"), String(" jsonrpc: Some(jsonrpc_core::Version::= V2),"), String(" method: method.to_owned(),"), String(" = params: params.to_params()?,"), String(" };"), String(" se= lf.writer_tx.send(RawMessage::Notification(msg))?;"), String(" Ok(()= )"), String(" }"), String(""), String(" pub fn output(&self, id: Id, = result: Result) -> Result<()> {"), String(" let outp= ut =3D match result {"), String(" Ok(ok) =3D> jsonrpc_core::Outp= ut::Success(jsonrpc_core::Success {"), String(" jsonrpc: Som= e(jsonrpc_core::Version::V2),"), String(" id: jsonrpc_core::= Id::Num(id),"), String(" result: serde_json::to_value(ok)?,"= ), String(" }),"), String(" Err(err) =3D> jsonrpc_cor= e::Output::Failure(jsonrpc_core::Failure {"), String(" jsonr= pc: Some(jsonrpc_core::Version::V2),"), String(" id: jsonrpc= _core::Id::Num(id),"), String(" error: err.to_rpc_error(),")= , String(" }),"), String(" };"), String(""), String(" = self.writer_tx.send(RawMessage::Output(output))?;"), String(" Ok= (())"), String(" }"), String("}"), String(""), String("fn loop_read("), = String(" reader: impl BufRead,"), String(" reader_rx: Receiver<(Id, S= ender)>,"), String(" sink: &Sender,"), Strin= g(" language_id: &LanguageId,"), String(") -> Result<()> {"), String(" = let mut pending_outputs =3D HashMap::new();"), String(""), String(" //= Count how many consequent empty lines."), String(" let mut count_empty_= lines =3D 0;"), String(""), String(" let mut reader =3D reader;"), Strin= g(" let mut content_length =3D 0;"), String(" loop {"), String(" = let mut message =3D String::new();"), String(" let mut line =3D S= tring::new();"), String(" if language_id.is_some() {"), String(" = reader.read_line(&mut line)?;"), String(" let line =3D l= ine.trim();"), String(" if line.is_empty() {"), String(" = count_empty_lines +=3D 1;"), String(" if count_empty= _lines > 5 {"), String(" return Err(anyhow!(\"Unable to = read from language server\"));"), String(" }"), String(""), = String(" let mut buf =3D vec![0; content_length];"), String(= " reader.read_exact(buf.as_mut_slice())?;"), String(" = message =3D String::from_utf8(buf)?;"), String(" } else= {"), String(" count_empty_lines =3D 0;"), String(" = if !line.starts_with(\"Content-Length\") {"), String(" = continue;"), String(" }"), String(""), String(" = let tokens: Vec<&str> =3D line.splitn(2, ':').collect();"), String= (" let len =3D tokens"), String(" .get(1)= "), String(" .ok_or_else(|| anyhow!(\"Failed to get leng= th! tokens: {:?}\", tokens))?"), String(" .trim();"), St= ring(" content_length =3D usize::from_str(len)?;"), String("= }"), String(" } else if reader.read_line(&mut message)? = =3D=3D 0 {"), String(" break;"), String(" }"), String("")= , String(" let message =3D message.trim();"), String(" if mes= sage.is_empty() {"), String(" continue;"), String(" }"), = String(" debug!(\"<=3D {:?} {}\", language_id, message);"), String("= // FIXME: Remove extra `meta` property from javascript-typescript-l= angserver and"), String(" // `requestMethod` sent by Sorbet."), Stri= ng(" let s =3D RE_REMOVE_EXTRA_FIELDS.replace(message, \"\");"), Str= ing(" let message =3D serde_json::from_str(&s);"), String(" i= f let Err(ref err) =3D message {"), String(" error!("), String("= \"Failed to deserialize output: {}\\n\\n Message: {}\\n\\nE= rror: {:?}\","), String(" err, s, err"), String(" = );"), String(" continue;"), String(" }"), String(" = // TODO: cleanup."), String(" let message =3D message.unwrap();"),= String(" match message {"), String(" RawMessage::MethodC= all(method_call) =3D> {"), String(" sink.send(Call::MethodCa= ll(language_id.clone(), method_call))?;"), String(" }"), String(= " RawMessage::Notification(notification) =3D> {"), String(" = sink.send(Call::Notification(language_id.clone(), notification))= ?;"), String(" }"), String(" RawMessage::Output(outpu= t) =3D> {"), String(" while let Ok((id, tx)) =3D reader_rx.t= ry_recv() {"), String(" pending_outputs.insert(id, tx);"= ), String(" }"), String(""), String(" if let = Some(tx) =3D pending_outputs.remove(&output.id().to_int()?) {"), String(" = tx.send(output)"), String(" .map_e= rr(|output| anyhow!(\"Failed to send output: {:?}\", output))?;"), String("= }"), String(" }"), String(" };"), String(= " }"), String(""), String(" info!(\"reader-{:?} terminated\", languag= e_id);"), String(" Ok(())"), String("}"), String(""), String("fn loop_wr= ite("), String(" writer: impl Write,"), String(" rx: &Receiver,"), String(" language_id: &LanguageId,"), String(") -> Result<()> = {"), String(" let mut writer =3D writer;"), String(""), String(" for = msg in rx.iter() {"), String(" let s =3D serde_json::to_string(&msg)= ?;"), String(" debug!(\"=3D> {:?} {}\", language_id, s);"), String("= if language_id.is_none() {"), String(" // Use different = convention for two reasons,"), String(" // 1. If using '\\r\\nco= ntent', nvim will receive output as `\\r` + `content`, while vim"), String(= " // receives `content`."), String(" // 2. Without la= st line ending, vim output handler won't be triggered."), String(" = write!(writer, \"Content-Length: {}\\n\\n{}\\n\", s.len(), s)?;"), Strin= g(" } else {"), String(" write!(writer, \"Content-Length:= {}\\r\\n\\r\\n{}\", s.len(), s)?;"), String(" };"), String(" = writer.flush()?;"), String(" }"), String(" Ok(())"), String("}"), St= ring(""), String("#[cfg(test)]"), String("mod test {"), String(" use sup= er::RE_REMOVE_EXTRA_FIELDS;"), String(" use crate::types::RawMessage;"),= String(""), String(" #[test]"), String(" // The library we're using = for json-rpc doesn't accept extra fields in the structs used to"), String("= // deserialize the message. Sorbet (and possibly other servers) sends a= n extra field in it, so"), String(" // the client fails to deserialize t= hat response."), String(" // Our previous solution was to pin the depend= ency to jsonrpc-core to version 12, but is"), String(" // suboptimal, so= we now try to remove the extra fields we know of from the response."), Str= ing(" //"), String(" // See related issue: https://github.com/autozim= u/LanguageClient-neovim/issues/892"), String(" fn it_should_remove_extra= _fields() {"), String(" // it removes the requestMethod field from S= orbet"), String(" let message =3D r#\"{\"jsonrpc\":\"2.0\",\"id\":1,= \"requestMethod\":\"initialize\",\"result\":0}\"#;"), String(" let m= essage =3D RE_REMOVE_EXTRA_FIELDS.replace(message, \"\");"), String(" = let result: Result =3D serde_json::from_str(&message);"), = String(" assert!(result.is_ok());"), String(""), String(" let= message =3D"), String(" r#\"{\"jsonrpc\":\"2.0\",\"id\":1,\"req= uestMethod\":\"textDocument/definition\",\"result\":0}\"#;"), String(" = let message =3D RE_REMOVE_EXTRA_FIELDS.replace(message, \"\");"), String= (" let result: Result =3D serde_json::from_str(&messa= ge);"), String(" assert!(result.is_ok());"), String(""), String(" = // it removes the meta field from javascript-typescript-langserver"), = String(" let message =3D r#\"{\"jsonrpc\":\"2.0\",\"id\":1,\"meta\":= {},\"result\":0}\"#;"), String(" let message =3D RE_REMOVE_EXTRA_FIE= LDS.replace(message, \"\");"), String(" let result: Result =3D serde_json::from_str(&message);"), String(" assert!(result= .is_ok());"), String(" }"), String("}"), String("")])}) 17:00:16 INFO unnamed src/language_server_protocol.rs:1993 text_document_di= d_change; params=3DObject({"bufnr": Number(1), "character": Number(45), "fi= lename": String("/home/dick/LanguageClient-neovim/src/rpcclient.rs"), "goto= Cmd": Null, "handle": Bool(true), "languageId": String("rust"), "line": Num= ber(49), "method": String("textDocument/definition"), "text": Array([String= ("use crate::types::{Call, Id, LSError, LanguageId, RawMessage, ToInt, ToPa= rams, ToRpcError};"), String("use anyhow::{anyhow, Result};"), String("use = crossbeam::channel::{bounded, unbounded, Receiver, Sender};"), String("use = log::*;"), String("use regex::Regex;"), String("use serde::{de::Deserialize= Owned, Serialize};"), String("use std::io::Write;"), String("use std::str::= FromStr;"), String("use std::{"), String(" collections::HashMap,"), Stri= ng(" io::BufRead,"), String(" sync::atomic::{AtomicU64, Ordering},"),= String(" thread,"), String(" time::Duration,"), String("};"), String= (""), String("const CONTENT_MODIFIED_ERROR_CODE: i64 =3D -32801;"), String(= ""), String("lazy_static! {"), String(" // this regex is used to remove = some additional fields that we get from some servers, namely:"), String(" = // meta, sent by javascript-typescript-langserver and requestMethod, sent= by Sorbet."), String(" static ref RE_REMOVE_EXTRA_FIELDS: Regex =3D"), = String(" Regex::new(r#\",\\s?\"(?:meta|requestMethod)\":(?:\"\\w+(/\= \w+)?\"|\\{\\})\"#).unwrap();"), String("}"), String(""), String("#[derive(= Serialize)]"), String("pub struct RpcClient {"), String(" language_id: L= anguageId,"), String(" #[serde(skip_serializing)]"), String(" id: Ato= micU64,"), String(" #[serde(skip_serializing)]"), String(" writer_tx:= Sender,"), String(" #[serde(skip_serializing)]"), String(" = reader_tx: Sender<(Id, Sender)>,"), String(" pu= b process_id: Option,"), String("}"), String(""), String("impl RpcClie= nt {"), String(" #[allow(clippy::new_ret_no_self)]"), String(" pub fn= new("), String(" language_id: LanguageId,"), String(" reader= : impl BufRead + Send + 'static,"), String(" writer: impl Write + Se= nd + 'static,"), String(" process_id: Option,"), String(" = sink: Sender,"), String(" on_crash: impl Fn(&LanguageId) + C= lone + Send + 'static,"), String(" ) -> Result {"), String(" = let (reader_tx, reader_rx): (Sender<(Id, Sender)>, = _) =3D unbounded();"), String(""), String(" let language_id_clone = =3D language_id.clone();"), String(" let reader_thread_name =3D form= at!(\"reader-{:?}\", language_id);"), String(" let on_crash_clone = =3D on_crash.clone();"), String(" thread::Builder::new()"), String("= .name(reader_thread_name.clone())"), String(" .spawn= (move || {"), String(" if let Err(err) =3D loop_read(reader,= reader_rx, &sink, &language_id_clone) {"), String(" mat= ch err.downcast_ref::() {"), String(" = Some(err) if err.kind() =3D=3D std::io::ErrorKind::UnexpectedEof =3D> {")= , String(" on_crash_clone(&language_id_clone)"),= String(" }"), String(" _ =3D= > {}"), String(" }"), String(""), String(" = error!(\"Thread {} exited with error: {:?}\", reader_thread_name, err= );"), String(" }"), String(" })?;"), String(""), = String(" let (writer_tx, writer_rx) =3D unbounded();"), String(" = let writer_thread_name =3D format!(\"writer-{:?}\", language_id);"), St= ring(" let language_id_clone =3D language_id.clone();"), String(" = thread::Builder::new()"), String(" .name(writer_thread_name= .clone())"), String(" .spawn(move || {"), String(" = if let Err(err) =3D loop_write(writer, &writer_rx, &language_id_clone) {"= ), String(" match err.downcast_ref::() {= "), String(" Some(err) if err.kind() =3D=3D std::io:= :ErrorKind::BrokenPipe =3D> {"), String(" on_cra= sh(&language_id_clone)"), String(" }"), String(" = _ =3D> {}"), String(" }"), String(""= ), String(" error!(\"Thread {} exited with error: {:?}\"= , writer_thread_name, err);"), String(" }"), String(" = })?;"), String(""), String(" Ok(Self {"), String(" l= anguage_id,"), String(" id: AtomicU64::default(),"), String(" = process_id,"), String(" reader_tx,"), String(" = writer_tx,"), String(" })"), String(" }"), String(""), String(= " pub fn call("), String(" &self,"), String(= " method: impl AsRef,"), String(" params: impl Serialize= ,"), String(" ) -> Result {"), String(" let method =3D method.= as_ref();"), String(" let id =3D self.id.fetch_add(1, Ordering::SeqC= st);"), String(" let msg =3D jsonrpc_core::MethodCall {"), String(" = jsonrpc: Some(jsonrpc_core::Version::V2),"), String(" = id: jsonrpc_core::Id::Num(id),"), String(" method: method.to_ow= ned(),"), String(" params: params.to_params()?,"), String(" = };"), String(" let (tx, rx) =3D bounded(1);"), String(" se= lf.reader_tx.send((id, tx))?;"), String(" self.writer_tx.send(RawMes= sage::MethodCall(msg))?;"), String(" // TODO: duration from config."= ), String(" match rx.recv_timeout(Duration::from_secs(60))? {"), Str= ing(" jsonrpc_core::Output::Success(ok) =3D> Ok(serde_json::from= _value(ok.result)?),"), String(" // NOTE: Errors with code -3280= 1 correspond to the protocol's ContentModified error,"), String(" = // which we don't want to show to the user and should ignore, as the resu= lt of the"), String(" // request that triggered this error has b= een invalidated by changes to the state"), String(" // of the se= rver, so we must handle this error specifically."), String(" jso= nrpc_core::Output::Failure(err)"), String(" if err.error.cod= e.code() =3D=3D CONTENT_MODIFIED_ERROR_CODE =3D>"), String(" {")= , String(" Err(anyhow::Error::from(LSError::ContentModified)= )"), String(" }"), String(" jsonrpc_core::Output::Fai= lure(err) =3D> Err(anyhow!(\"Error: {:?}\", err)),"), String(" }"), = String(" }"), String(""), String(" pub fn notify(&self, method: impl = AsRef, params: impl Serialize) -> Result<()> {"), String(" let = method =3D method.as_ref();"), String(""), String(" let msg =3D json= rpc_core::Notification {"), String(" jsonrpc: Some(jsonrpc_core:= :Version::V2),"), String(" method: method.to_owned(),"), String(= " params: params.to_params()?,"), String(" };"), String("= self.writer_tx.send(RawMessage::Notification(msg))?;"), String(" = Ok(())"), String(" }"), String(""), String(" pub fn output(&self= , id: Id, result: Result) -> Result<()> {"), String(" = let output =3D match result {"), String(" Ok(ok) =3D> jsonrpc_= core::Output::Success(jsonrpc_core::Success {"), String(" js= onrpc: Some(jsonrpc_core::Version::V2),"), String(" id: json= rpc_core::Id::Num(id),"), String(" result: serde_json::to_va= lue(ok)?,"), String(" }),"), String(" Err(err) =3D> j= sonrpc_core::Output::Failure(jsonrpc_core::Failure {"), String(" = jsonrpc: Some(jsonrpc_core::Version::V2),"), String(" i= d: jsonrpc_core::Id::Num(id),"), String(" error: err.to_rpc_= error(),"), String(" }),"), String(" };"), String(""), St= ring(" self.writer_tx.send(RawMessage::Output(output))?;"), String("= Ok(())"), String(" }"), String("}"), String(""), String("fn loop= _read("), String(" reader: impl BufRead,"), String(" reader_rx: Recei= ver<(Id, Sender)>,"), String(" sink: &Sender= ,"), String(" language_id: &LanguageId,"), String(") -> Result<()> {"), = String(" let mut pending_outputs =3D HashMap::new();"), String(""), Stri= ng(" // Count how many consequent empty lines."), String(" let mut co= unt_empty_lines =3D 0;"), String(""), String(" let mut reader =3D reader= ;"), String(" let mut content_length =3D 0;"), String(" loop {"), Str= ing(" let mut message =3D String::new();"), String(" let mut = line =3D String::new();"), String(" if language_id.is_some() {"), St= ring(" reader.read_line(&mut line)?;"), String(" let = line =3D line.trim();"), String(" if line.is_empty() {"), String= (" count_empty_lines +=3D 1;"), String(" if c= ount_empty_lines > 5 {"), String(" return Err(anyhow!(\"= Unable to read from language server\"));"), String(" }"), St= ring(""), String(" let mut buf =3D vec![0; content_length];"= ), String(" reader.read_exact(buf.as_mut_slice())?;"), Strin= g(" message =3D String::from_utf8(buf)?;"), String(" = } else {"), String(" count_empty_lines =3D 0;"), String(= " if !line.starts_with(\"Content-Length\") {"), String(" = continue;"), String(" }"), String(""), Strin= g(" let tokens: Vec<&str> =3D line.splitn(2, ':').collect();= "), String(" let len =3D tokens"), String(" = .get(1)"), String(" .ok_or_else(|| anyhow!(\"Failed t= o get length! tokens: {:?}\", tokens))?"), String(" .tri= m();"), String(" content_length =3D usize::from_str(len)?;")= , String(" }"), String(" } else if reader.read_line(&mut = message)? =3D=3D 0 {"), String(" break;"), String(" }"), = String(""), String(" let message =3D message.trim();"), String(" = if message.is_empty() {"), String(" continue;"), String(" = }"), String(" debug!(\"<=3D {:?} {}\", language_id, message);")= , String(" // FIXME: Remove extra `meta` property from javascript-ty= pescript-langserver and"), String(" // `requestMethod` sent by Sorbe= t."), String(" let s =3D RE_REMOVE_EXTRA_FIELDS.replace(message, \"\= ");"), String(" let message =3D serde_json::from_str(&s);"), String(= " if let Err(ref err) =3D message {"), String(" error!(")= , String(" \"Failed to deserialize output: {}\\n\\n Message:= {}\\n\\nError: {:?}\","), String(" err, s, err"), String(" = );"), String(" continue;"), String(" }"), Stri= ng(" // TODO: cleanup."), String(" let message =3D message.un= wrap();"), String(" match message {"), String(" RawMessag= e::MethodCall(method_call) =3D> {"), String(" sink.send(Call= ::MethodCall(language_id.clone(), method_call))?;"), String(" }"= ), String(" RawMessage::Notification(notification) =3D> {"), Str= ing(" sink.send(Call::Notification(language_id.clone(), noti= fication))?;"), String(" }"), String(" RawMessage::Ou= tput(output) =3D> {"), String(" while let Ok((id, tx)) =3D r= eader_rx.try_recv() {"), String(" pending_outputs.insert= (id, tx);"), String(" }"), String(""), String(" = if let Some(tx) =3D pending_outputs.remove(&output.id().to_int()?) {"), = String(" tx.send(output)"), String(" = .map_err(|output| anyhow!(\"Failed to send output: {:?}\", output))?;")= , String(" }"), String(" }"), String(" };"= ), String(" }"), String(""), String(" info!(\"reader-{:?} terminated\= ", language_id);"), String(" Ok(())"), String("}"), String(""), String("= fn loop_write("), String(" writer: impl Write,"), String(" rx: &Recei= ver,"), String(" language_id: &LanguageId,"), String(") -> R= esult<()> {"), String(" let mut writer =3D writer;"), String(""), String= (" for msg in rx.iter() {"), String(" let s =3D serde_json::to_st= ring(&msg)?;"), String(" debug!(\"=3D> {:?} {}\", language_id, s);")= , String(" if language_id.is_none() {"), String(" // Use = different convention for two reasons,"), String(" // 1. If using= '\\r\\ncontent', nvim will receive output as `\\r` + `content`, while vim"= ), String(" // receives `content`."), String(" // 2. = Without last line ending, vim output handler won't be triggered."), String(= " write!(writer, \"Content-Length: {}\\n\\n{}\\n\", s.len(), s)?= ;"), String(" } else {"), String(" write!(writer, \"Conte= nt-Length: {}\\r\\n\\r\\n{}\", s.len(), s)?;"), String(" };"), Strin= g(" writer.flush()?;"), String(" }"), String(" Ok(())"), Strin= g("}"), String(""), String("#[cfg(test)]"), String("mod test {"), String(" = use super::RE_REMOVE_EXTRA_FIELDS;"), String(" use crate::types::RawM= essage;"), String(""), String(" #[test]"), String(" // The library we= 're using for json-rpc doesn't accept extra fields in the structs used to")= , String(" // deserialize the message. Sorbet (and possibly other server= s) sends an extra field in it, so"), String(" // the client fails to des= erialize that response."), String(" // Our previous solution was to pin = the dependency to jsonrpc-core to version 12, but is"), String(" // subo= ptimal, so we now try to remove the extra fields we know of from the respon= se."), String(" //"), String(" // See related issue: https://github.c= om/autozimu/LanguageClient-neovim/issues/892"), String(" fn it_should_re= move_extra_fields() {"), String(" // it removes the requestMethod fi= eld from Sorbet"), String(" let message =3D r#\"{\"jsonrpc\":\"2.0\"= ,\"id\":1,\"requestMethod\":\"initialize\",\"result\":0}\"#;"), String(" = let message =3D RE_REMOVE_EXTRA_FIELDS.replace(message, \"\");"), Stri= ng(" let result: Result =3D serde_json::from_str(&mes= sage);"), String(" assert!(result.is_ok());"), String(""), String(" = let message =3D"), String(" r#\"{\"jsonrpc\":\"2.0\",\"id= \":1,\"requestMethod\":\"textDocument/definition\",\"result\":0}\"#;"), Str= ing(" let message =3D RE_REMOVE_EXTRA_FIELDS.replace(message, \"\");= "), String(" let result: Result =3D serde_json::from_= str(&message);"), String(" assert!(result.is_ok());"), String(""), S= tring(" // it removes the meta field from javascript-typescript-lang= server"), String(" let message =3D r#\"{\"jsonrpc\":\"2.0\",\"id\":1= ,\"meta\":{},\"result\":0}\"#;"), String(" let message =3D RE_REMOVE= _EXTRA_FIELDS.replace(message, \"\");"), String(" let result: Result= =3D serde_json::from_str(&message);"), String(" asse= rt!(result.is_ok());"), String(" }"), String("}"), String("")])}) 17:00:16 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"LSP#text","params":["/home/dick/LanguageClient-neovim/src/rpcclie= nt.rs"],"id":25} 17:00:16 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 25, "jsonr= pc": "2.0", "result": ["use crate::types::{Call, Id, LSError, LanguageId, R= awMessage, ToInt, ToParams, ToRpcError};", "use anyhow::{anyhow, Result};",= "use crossbeam::channel::{bounded, unbounded, Receiver, Sender};", "use lo= g::*;", "use regex::Regex;", "use serde::{de::DeserializeOwned, Serialize};= ", "use std::io::Write;", "use std::str::FromStr;", "use std::{", " coll= ections::HashMap,", " io::BufRead,", " sync::atomic::{AtomicU64, Orde= ring},", " thread,", " time::Duration,", "};", "", "const CONTENT_MOD= IFIED_ERROR_CODE: i64 =3D -32801;", "", "lazy_static! {", " // this rege= x is used to remove some additional fields that we get from some servers, n= amely:", " // meta, sent by javascript-typescript-langserver and request= Method, sent by Sorbet.", " static ref RE_REMOVE_EXTRA_FIELDS: Regex =3D= ", " Regex::new(r#\",\\s?\"(?:meta|requestMethod)\":(?:\"\\w+(/\\w+)= ?\"|\\{\\})\"#).unwrap();", "}", "", "#[derive(Serialize)]", "pub struct Rp= cClient {", " language_id: LanguageId,", " #[serde(skip_serializing)]= ", " id: AtomicU64,", " #[serde(skip_serializing)]", " writer_tx: = Sender,", " #[serde(skip_serializing)]", " reader_tx: Sen= der<(Id, Sender)>,", " pub process_id: Option= ,", "}", "", "impl RpcClient {", " #[allow(clippy::new_ret_no_self)]", "= pub fn new(", " language_id: LanguageId,", " reader: impl= BufRead + Send + 'static,", " writer: impl Write + Send + 'static,"= , " process_id: Option,", " sink: Sender,", " = on_crash: impl Fn(&LanguageId) + Clone + Send + 'static,", " ) -> Res= ult {", " let (reader_tx, reader_rx): (Sender<(Id, Sender)>, _) =3D unbounded();", "", " let language_id_clo= ne =3D language_id.clone();", " let reader_thread_name =3D format!(\= "reader-{:?}\", language_id);", " let on_crash_clone =3D on_crash.cl= one();", " thread::Builder::new()", " .name(reader_thread= _name.clone())", " .spawn(move || {", " if let Er= r(err) =3D loop_read(reader, reader_rx, &sink, &language_id_clone) {", " = match err.downcast_ref::() {", " = Some(err) if err.kind() =3D=3D std::io::ErrorKind::Unexpected= Eof =3D> {", " on_crash_clone(&language_id_clone= )", " }", " _ =3D> {}", " = }", "", " error!(\"Thread {} exited with= error: {:?}\", reader_thread_name, err);", " }", " = })?;", "", " let (writer_tx, writer_rx) =3D unbounded();", " = let writer_thread_name =3D format!(\"writer-{:?}\", language_id);", " = let language_id_clone =3D language_id.clone();", " thread::Buil= der::new()", " .name(writer_thread_name.clone())", " = .spawn(move || {", " if let Err(err) =3D loop_write(writer, = &writer_rx, &language_id_clone) {", " match err.downcast= _ref::() {", " Some(err) if err.kind= () =3D=3D std::io::ErrorKind::BrokenPipe =3D> {", " = on_crash(&language_id_clone)", " }", " = _ =3D> {}", " }", "", " = error!(\"Thread {} exited with error: {:?}\", writer_thread_name, err);", = " }", " })?;", "", " Ok(Self {", " = language_id,", " id: AtomicU64::default(),", " pr= ocess_id,", " reader_tx,", " writer_tx,", " })= ", " }", "", " pub fn call(", " &self,", = " method: impl AsRef,", " params: impl Serialize,", " = ) -> Result {", " let method =3D method.as_ref();", " let= id =3D self.id.fetch_add(1, Ordering::SeqCst);", " let msg =3D json= rpc_core::MethodCall {", " jsonrpc: Some(jsonrpc_core::Version::= V2),", " id: jsonrpc_core::Id::Num(id),", " method: m= ethod.to_owned(),", " params: params.to_params()?,", " };= ", " let (tx, rx) =3D bounded(1);", " self.reader_tx.send((id= , tx))?;", " self.writer_tx.send(RawMessage::MethodCall(msg))?;", " = // TODO: duration from config.", " match rx.recv_timeout(Dura= tion::from_secs(60))? {", " jsonrpc_core::Output::Success(ok) = =3D> Ok(serde_json::from_value(ok.result)?),", " // NOTE: Errors= with code -32801 correspond to the protocol's ContentModified error,", " = // which we don't want to show to the user and should ignore, as = the result of the", " // request that triggered this error has b= een invalidated by changes to the state", " // of the server, so= we must handle this error specifically.", " jsonrpc_core::Outpu= t::Failure(err)", " if err.error.code.code() =3D=3D CONTENT_= MODIFIED_ERROR_CODE =3D>", " {", " Err(anyhow::Er= ror::from(LSError::ContentModified))", " }", " jsonrp= c_core::Output::Failure(err) =3D> Err(anyhow!(\"Error: {:?}\", err)),", " = }", " }", "", " pub fn notify(&self, method: impl AsRef, p= arams: impl Serialize) -> Result<()> {", " let method =3D method.as_= ref();", "", " let msg =3D jsonrpc_core::Notification {", " = jsonrpc: Some(jsonrpc_core::Version::V2),", " method: method.= to_owned(),", " params: params.to_params()?,", " };", " = self.writer_tx.send(RawMessage::Notification(msg))?;", " Ok(()= )", " }", "", " pub fn output(&self, id: Id, result: Result) -> Result<()> {", " let output =3D match result {", " = Ok(ok) =3D> jsonrpc_core::Output::Success(jsonrpc_core::Success {", " = jsonrpc: Some(jsonrpc_core::Version::V2),", " = id: jsonrpc_core::Id::Num(id),", " result: serde_json::to_v= alue(ok)?,", " }),", " Err(err) =3D> jsonrpc_core::Ou= tput::Failure(jsonrpc_core::Failure {", " jsonrpc: Some(json= rpc_core::Version::V2),", " id: jsonrpc_core::Id::Num(id),",= " error: err.to_rpc_error(),", " }),", " = };", "", " self.writer_tx.send(RawMessage::Output(output))?;", " = Ok(())", " }", "}", "", "fn loop_read(", " reader: impl BufRead,"= , " reader_rx: Receiver<(Id, Sender)>,", " sink= : &Sender,", " language_id: &LanguageId,", ") -> Result<()> {", " = let mut pending_outputs =3D HashMap::new();", "", " // Count how many= consequent empty lines.", " let mut count_empty_lines =3D 0;", "", " = let mut reader =3D reader;", " let mut content_length =3D 0;", " loo= p {", " let mut message =3D String::new();", " let mut line = =3D String::new();", " if language_id.is_some() {", " rea= der.read_line(&mut line)?;", " let line =3D line.trim();", " = if line.is_empty() {", " count_empty_lines +=3D 1;",= " if count_empty_lines > 5 {", " return = Err(anyhow!(\"Unable to read from language server\"));", " }= ", "", " let mut buf =3D vec![0; content_length];", " = reader.read_exact(buf.as_mut_slice())?;", " message= =3D String::from_utf8(buf)?;", " } else {", " co= unt_empty_lines =3D 0;", " if !line.starts_with(\"Content-Le= ngth\") {", " continue;", " }", "", " = let tokens: Vec<&str> =3D line.splitn(2, ':').collect();", " = let len =3D tokens", " .get(1)", " = .ok_or_else(|| anyhow!(\"Failed to get length! tokens: {:?}\", t= okens))?", " .trim();", " content_length = =3D usize::from_str(len)?;", " }", " } else if reader.rea= d_line(&mut message)? =3D=3D 0 {", " break;", " }", "", "= let message =3D message.trim();", " if message.is_empty() {"= , " continue;", " }", " debug!(\"<=3D {:?} {}\", l= anguage_id, message);", " // FIXME: Remove extra `meta` property fro= m javascript-typescript-langserver and", " // `requestMethod` sent b= y Sorbet.", " let s =3D RE_REMOVE_EXTRA_FIELDS.replace(message, \"\"= );", " let message =3D serde_json::from_str(&s);", " if let E= rr(ref err) =3D message {", " error!(", " \"Faile= d to deserialize output: {}\\n\\n Message: {}\\n\\nError: {:?}\",", " = err, s, err", " );", " continue;", " = }", " // TODO: cleanup.", " let message =3D message.unwrap()= ;", " match message {", " RawMessage::MethodCall(method_c= all) =3D> {", " sink.send(Call::MethodCall(language_id.clone= (), method_call))?;", " }", " RawMessage::Notificatio= n(notification) =3D> {", " sink.send(Call::Notification(lang= uage_id.clone(), notification))?;", " }", " RawMessag= e::Output(output) =3D> {", " while let Ok((id, tx)) =3D read= er_rx.try_recv() {", " pending_outputs.insert(id, tx);",= " }", "", " if let Some(tx) =3D pending_outp= uts.remove(&output.id().to_int()?) {", " tx.send(output)= ", " .map_err(|output| anyhow!(\"Failed to send outp= ut: {:?}\", output))?;", " }", " }", " };"= , " }", "", " info!(\"reader-{:?} terminated\", language_id);", " = Ok(())", "}", "", "fn loop_write(", " writer: impl Write,", " rx: &Re= ceiver,", " language_id: &LanguageId,", ") -> Result<()> {",= " let mut writer =3D writer;", "", " for msg in rx.iter() {", " = let s =3D serde_json::to_string(&msg)?;", " debug!(\"=3D> {:?} {}= \", language_id, s);", " if language_id.is_none() {", " /= / Use different convention for two reasons,", " // 1. If using '= \\r\\ncontent', nvim will receive output as `\\r` + `content`, while vim", = " // receives `content`.", " // 2. Without last line = ending, vim output handler won't be triggered.", " write!(writer= , \"Content-Length: {}\\n\\n{}\\n\", s.len(), s)?;", " } else {", " = write!(writer, \"Content-Length: {}\\r\\n\\r\\n{}\", s.len(), s)= ?;", " };", " writer.flush()?;", " }", " Ok(())", "}", = "", "#[cfg(test)]", "mod test {", " use super::RE_REMOVE_EXTRA_FIELDS;",= " use crate::types::RawMessage;", "", " #[test]", " // The librar= y we're using for json-rpc doesn't accept extra fields in the structs used = to", " // deserialize the message. Sorbet (and possibly other servers) s= ends an extra field in it, so", " // the client fails to deserialize tha= t response.", " // Our previous solution was to pin the dependency to js= onrpc-core to version 12, but is", " // suboptimal, so we now try to rem= ove the extra fields we know of from the response.", " //", " // See = related issue: https://github.com/autozimu/LanguageClient-neovim/issues/892= ", " fn it_should_remove_extra_fields() {", " // it removes the r= equestMethod field from Sorbet", " let message =3D r#\"{\"jsonrpc\":= \"2.0\",\"id\":1,\"requestMethod\":\"initialize\",\"result\":0}\"#;", " = let message =3D RE_REMOVE_EXTRA_FIELDS.replace(message, \"\");", " = let result: Result =3D serde_json::from_str(&message);", = " assert!(result.is_ok());", "", " let message =3D", " = r#\"{\"jsonrpc\":\"2.0\",\"id\":1,\"requestMethod\":\"textDocument/def= inition\",\"result\":0}\"#;", " let message =3D RE_REMOVE_EXTRA_FIEL= DS.replace(message, \"\");", " let result: Result =3D= serde_json::from_str(&message);", " assert!(result.is_ok());", "", = " // it removes the meta field from javascript-typescript-langserver= ", " let message =3D r#\"{\"jsonrpc\":\"2.0\",\"id\":1,\"meta\":{},\= "result\":0}\"#;", " let message =3D RE_REMOVE_EXTRA_FIELDS.replace(= message, \"\");", " let result: Result =3D serde_json= ::from_str(&message);", " assert!(result.is_ok());", " }", "}", "= "]} 17:00:16 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"eval","params":["LSP#position()"],"id":26} 17:00:16 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 26, "jsonr= pc": "2.0", "result": {"character": 45, "line": 49}} 17:00:16 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"eval","params":["expand('')"],"id":27} 17:00:16 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 27, "jsonr= pc": "2.0", "result": "clone"} 17:00:16 DEBUG writer-Some("rust") src/rpcclient.rs:254 =3D> Some("rust") {= "jsonrpc":"2.0","method":"textDocument/definition","params":{"bufnr":1,"cha= racter":45,"filename":"/home/dick/LanguageClient-neovim/src/rpcclient.rs","= gotoCmd":null,"handle":true,"languageId":"rust","line":49,"method":"textDoc= ument/definition","position":{"character":45,"line":49},"text":["use crate:= :types::{Call, Id, LSError, LanguageId, RawMessage, ToInt, ToParams, ToRpcE= rror};","use anyhow::{anyhow, Result};","use crossbeam::channel::{bounded, = unbounded, Receiver, Sender};","use log::*;","use regex::Regex;","use serde= ::{de::DeserializeOwned, Serialize};","use std::io::Write;","use std::str::= FromStr;","use std::{"," collections::HashMap,"," io::BufRead,"," = sync::atomic::{AtomicU64, Ordering},"," thread,"," time::Duration,","= };","","const CONTENT_MODIFIED_ERROR_CODE: i64 =3D -32801;","","lazy_static= ! {"," // this regex is used to remove some additional fields that we ge= t from some servers, namely:"," // meta, sent by javascript-typescript-l= angserver and requestMethod, sent by Sorbet."," static ref RE_REMOVE_EXT= RA_FIELDS: Regex =3D"," Regex::new(r#\",\\s?\"(?:meta|requestMethod)= \":(?:\"\\w+(/\\w+)?\"|\\{\\})\"#).unwrap();","}","","#[derive(Serialize)]"= ,"pub struct RpcClient {"," language_id: LanguageId,"," #[serde(skip_= serializing)]"," id: AtomicU64,"," #[serde(skip_serializing)]"," w= riter_tx: Sender,"," #[serde(skip_serializing)]"," reader= _tx: Sender<(Id, Sender)>,"," pub process_id: Opti= on,","}","","impl RpcClient {"," #[allow(clippy::new_ret_no_self)]"= ," pub fn new("," language_id: LanguageId,"," reader: impl= BufRead + Send + 'static,"," writer: impl Write + Send + 'static,",= " process_id: Option,"," sink: Sender,"," o= n_crash: impl Fn(&LanguageId) + Clone + Send + 'static,"," ) -> Result {"," let (reader_tx, reader_rx): (Sender<(Id, Sender)>, _) =3D unbounded();",""," let language_id_clone =3D l= anguage_id.clone();"," let reader_thread_name =3D format!(\"reader-{= :?}\", language_id);"," let on_crash_clone =3D on_crash.clone();"," = thread::Builder::new()"," .name(reader_thread_name.clone(= ))"," .spawn(move || {"," if let Err(err) =3D loo= p_read(reader, reader_rx, &sink, &language_id_clone) {"," = match err.downcast_ref::() {"," So= me(err) if err.kind() =3D=3D std::io::ErrorKind::UnexpectedEof =3D> {"," = on_crash_clone(&language_id_clone)"," = }"," _ =3D> {}"," }","= "," error!(\"Thread {} exited with error: {:?}\", reader= _thread_name, err);"," }"," })?;",""," let= (writer_tx, writer_rx) =3D unbounded();"," let writer_thread_name = =3D format!(\"writer-{:?}\", language_id);"," let language_id_clone = =3D language_id.clone();"," thread::Builder::new()"," .na= me(writer_thread_name.clone())"," .spawn(move || {"," = if let Err(err) =3D loop_write(writer, &writer_rx, &language_id_clone)= {"," match err.downcast_ref::() {"," = Some(err) if err.kind() =3D=3D std::io::ErrorKind::Bro= kenPipe =3D> {"," on_crash(&language_id_clone)",= " }"," _ =3D> {}"," = }",""," error!(\"Thread {} exited with error: = {:?}\", writer_thread_name, err);"," }"," })?;","= "," Ok(Self {"," language_id,"," id: AtomicU64= ::default(),"," process_id,"," reader_tx,"," = writer_tx,"," })"," }",""," pub fn call("," &self,"," method: impl AsRef,"," params: im= pl Serialize,"," ) -> Result {"," let method =3D method.as_ref= ();"," let id =3D self.id.fetch_add(1, Ordering::SeqCst);"," = let msg =3D jsonrpc_core::MethodCall {"," jsonrpc: Some(jsonrpc_= core::Version::V2),"," id: jsonrpc_core::Id::Num(id),"," = method: method.to_owned(),"," params: params.to_params()?,",= " };"," let (tx, rx) =3D bounded(1);"," self.reader_tx= .send((id, tx))?;"," self.writer_tx.send(RawMessage::MethodCall(msg)= )?;"," // TODO: duration from config."," match rx.recv_timeou= t(Duration::from_secs(60))? {"," jsonrpc_core::Output::Success(o= k) =3D> Ok(serde_json::from_value(ok.result)?),"," // NOTE: Erro= rs with code -32801 correspond to the protocol's ContentModified error,"," = // which we don't want to show to the user and should ignore, as= the result of the"," // request that triggered this error has b= een invalidated by changes to the state"," // of the server, so = we must handle this error specifically."," jsonrpc_core::Output:= :Failure(err)"," if err.error.code.code() =3D=3D CONTENT_MOD= IFIED_ERROR_CODE =3D>"," {"," Err(anyhow::Error::= from(LSError::ContentModified))"," }"," jsonrpc_core:= :Output::Failure(err) =3D> Err(anyhow!(\"Error: {:?}\", err)),"," }"= ," }",""," pub fn notify(&self, method: impl AsRef, params: impl= Serialize) -> Result<()> {"," let method =3D method.as_ref();","","= let msg =3D jsonrpc_core::Notification {"," jsonrpc: Som= e(jsonrpc_core::Version::V2),"," method: method.to_owned(),"," = params: params.to_params()?,"," };"," self.writer_t= x.send(RawMessage::Notification(msg))?;"," Ok(())"," }",""," p= ub fn output(&self, id: Id, result: Result) -> Result<()> {= "," let output =3D match result {"," Ok(ok) =3D> jsonrpc_= core::Output::Success(jsonrpc_core::Success {"," jsonrpc: So= me(jsonrpc_core::Version::V2),"," id: jsonrpc_core::Id::Num(= id),"," result: serde_json::to_value(ok)?,"," }),= "," Err(err) =3D> jsonrpc_core::Output::Failure(jsonrpc_core::Fa= ilure {"," jsonrpc: Some(jsonrpc_core::Version::V2),"," = id: jsonrpc_core::Id::Num(id),"," error: err.to_r= pc_error(),"," }),"," };",""," self.writer_tx.send= (RawMessage::Output(output))?;"," Ok(())"," }","}","","fn loop_re= ad("," reader: impl BufRead,"," reader_rx: Receiver<(Id, Sender)>,"," sink: &Sender,"," language_id: &Language= Id,",") -> Result<()> {"," let mut pending_outputs =3D HashMap::new();",= ""," // Count how many consequent empty lines."," let mut count_empty= _lines =3D 0;",""," let mut reader =3D reader;"," let mut content_len= gth =3D 0;"," loop {"," let mut message =3D String::new();"," = let mut line =3D String::new();"," if language_id.is_some() {","= reader.read_line(&mut line)?;"," let line =3D line.t= rim();"," if line.is_empty() {"," count_empty_lin= es +=3D 1;"," if count_empty_lines > 5 {"," = return Err(anyhow!(\"Unable to read from language server\"));"," = }",""," let mut buf =3D vec![0; content_length];"," = reader.read_exact(buf.as_mut_slice())?;"," me= ssage =3D String::from_utf8(buf)?;"," } else {"," = count_empty_lines =3D 0;"," if !line.starts_with(\"Content-= Length\") {"," continue;"," }",""," = let tokens: Vec<&str> =3D line.splitn(2, ':').collect();"," = let len =3D tokens"," .get(1)"," = .ok_or_else(|| anyhow!(\"Failed to get length! tokens: {:?}\", tokens= ))?"," .trim();"," content_length =3D usi= ze::from_str(len)?;"," }"," } else if reader.read_line(&m= ut message)? =3D=3D 0 {"," break;"," }",""," let m= essage =3D message.trim();"," if message.is_empty() {"," = continue;"," }"," debug!(\"<=3D {:?} {}\", language_id, messa= ge);"," // FIXME: Remove extra `meta` property from javascript-types= cript-langserver and"," // `requestMethod` sent by Sorbet."," = let s =3D RE_REMOVE_EXTRA_FIELDS.replace(message, \"\");"," let mes= sage =3D serde_json::from_str(&s);"," if let Err(ref err) =3D messag= e {"," error!("," \"Failed to deserialize output:= {}\\n\\n Message: {}\\n\\nError: {:?}\","," err, s, err"," = );"," continue;"," }"," // TODO: cleanu= p."," let message =3D message.unwrap();"," match message {","= RawMessage::MethodCall(method_call) =3D> {"," si= nk.send(Call::MethodCall(language_id.clone(), method_call))?;"," = }"," RawMessage::Notification(notification) =3D> {"," = sink.send(Call::Notification(language_id.clone(), notification))?;","= }"," RawMessage::Output(output) =3D> {"," = while let Ok((id, tx)) =3D reader_rx.try_recv() {"," = pending_outputs.insert(id, tx);"," }",""," = if let Some(tx) =3D pending_outputs.remove(&output.id().to_int()?) {"," = tx.send(output)"," .map_err(|output|= anyhow!(\"Failed to send output: {:?}\", output))?;"," }","= }"," };"," }",""," info!(\"reader-{:?} terminated\= ", language_id);"," Ok(())","}","","fn loop_write("," writer: impl Wr= ite,"," rx: &Receiver,"," language_id: &LanguageId,",") -= > Result<()> {"," let mut writer =3D writer;",""," for msg in rx.iter= () {"," let s =3D serde_json::to_string(&msg)?;"," debug!(\"= =3D> {:?} {}\", language_id, s);"," if language_id.is_none() {"," = // Use different convention for two reasons,"," // 1. I= f using '\\r\\ncontent', nvim will receive output as `\\r` + `content`, whi= le vim"," // receives `content`."," // 2. Without las= t line ending, vim output handler won't be triggered."," write!(= writer, \"Content-Length: {}\\n\\n{}\\n\", s.len(), s)?;"," } else {= "," write!(writer, \"Content-Length: {}\\r\\n\\r\\n{}\", s.len()= , s)?;"," };"," writer.flush()?;"," }"," Ok(())","}",""= ,"#[cfg(test)]","mod test {"," use super::RE_REMOVE_EXTRA_FIELDS;"," = use crate::types::RawMessage;",""," #[test]"," // The library we're u= sing for json-rpc doesn't accept extra fields in the structs used to"," = // deserialize the message. Sorbet (and possibly other servers) sends an ex= tra field in it, so"," // the client fails to deserialize that response.= "," // Our previous solution was to pin the dependency to jsonrpc-core t= o version 12, but is"," // suboptimal, so we now try to remove the extra= fields we know of from the response."," //"," // See related issue: = https://github.com/autozimu/LanguageClient-neovim/issues/892"," fn it_sh= ould_remove_extra_fields() {"," // it removes the requestMethod fiel= d from Sorbet"," let message =3D r#\"{\"jsonrpc\":\"2.0\",\"id\":1,\= "requestMethod\":\"initialize\",\"result\":0}\"#;"," let message =3D= RE_REMOVE_EXTRA_FIELDS.replace(message, \"\");"," let result: Resul= t =3D serde_json::from_str(&message);"," assert!(resu= lt.is_ok());",""," let message =3D"," r#\"{\"jsonrpc\":\"= 2.0\",\"id\":1,\"requestMethod\":\"textDocument/definition\",\"result\":0}\= "#;"," let message =3D RE_REMOVE_EXTRA_FIELDS.replace(message, \"\")= ;"," let result: Result =3D serde_json::from_str(&mes= sage);"," assert!(result.is_ok());",""," // it removes the me= ta field from javascript-typescript-langserver"," let message =3D r#= \"{\"jsonrpc\":\"2.0\",\"id\":1,\"meta\":{},\"result\":0}\"#;"," let= message =3D RE_REMOVE_EXTRA_FIELDS.replace(message, \"\");"," let r= esult: Result =3D serde_json::from_str(&message);"," = assert!(result.is_ok());"," }","}",""],"textDocument":{"uri":"file:///ho= me/dick/LanguageClient-neovim/src/rpcclient.rs"}},"id":2} 17:00:16 DEBUG reader-Some("rust") src/rpcclient.rs:207 <=3D Some("rust") {= "jsonrpc":"2.0","id":2,"result":[{"originSelectionRange":{"start":{"line":4= 9,"character":44},"end":{"line":49,"character":49}},"targetUri":"file:///ho= me/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/= rust/library/core/src/option.rs","targetRange":{"start":{"line":1886,"chara= cter":4},"end":{"line":1892,"character":5}},"targetSelectionRange":{"start"= :{"line":1887,"character":7},"end":{"line":1887,"character":12}}}]} 17:00:16 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:Edit","params":["edit","/home/dick/.rustup/toolchains/stable-x8= 6_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"]} 17:00:16 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"cursor","params":[1888,8]} 17:00:16 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"eval","params":["expand('%')"],"id":28} 17:00:16 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleFileType", "jsonrpc": "2.0", "params": {"bufnr": 2, "viewpo= rt": {"end": 22, "start": 0}, "languageId": "rust", "position": {"character= ": 0, "line": 0}, "filename": "/home/dick/.rustup/toolchains/stable-x86_64-= unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"}} 17:00:16 INFO unnamed src/language_server_protocol.rs:2760 handle_file_type= ; params=3DObject({"bufnr": Number(2), "filename": String("/home/dick/.rust= up/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/= core/src/option.rs"), "languageId": String("rust"), "position": Object({"ch= aracter": Number(0), "line": Number(0)}), "viewport": Object({"end": Number= (22), "start": Number(0)})}) 17:00:16 INFO unnamed src/language_server_protocol.rs:1946 text_document_di= d_open; params=3DObject({"bufnr": Number(2), "filename": String("/home/dick= /.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/li= brary/core/src/option.rs"), "languageId": String("rust"), "position": Objec= t({"character": Number(0), "line": Number(0)}), "viewport": Object({"end": = Number(22), "start": Number(0)})}) 17:00:16 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"LSP#text","params":["/home/dick/.rustup/toolchains/stable-x86_64-= unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"],"id":29} 17:00:16 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleBufEnter", "jsonrpc": "2.0", "params": {"bufnr": 2, "langua= geId": "rust", "filename": "/home/dick/.rustup/toolchains/stable-x86_64-unk= nown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"}} 17:00:16 INFO unnamed src/language_server_protocol.rs:2739 handle_buf_enter= ; params=3DObject({"bufnr": Number(2), "filename": String("/home/dick/.rust= up/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/= core/src/option.rs"), "languageId": String("rust")}) 17:00:16 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"setbufvar","params":["/home/dick/.rustup/toolchains/stable-x86_64= -unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs","Langua= geClient_isServerRunning",1]} 17:00:16 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 28, "jsonr= pc": "2.0", "result": "/home/dick/.rustup/toolchains/stable-x86_64-unknown-= linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"} 17:00:16 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:EchomsgEllipsis","params":["/home/dick/.rustup/toolchains/stabl= e-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs = 1888:8"]} 17:00:16 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "result":[{"originSelectionRange":{"end":{"character":49,"line":49},"start"= :{"character":44,"line":49}},"targetRange":{"end":{"character":5,"line":189= 2},"start":{"character":4,"line":1886}},"targetSelectionRange":{"end":{"cha= racter":12,"line":1887},"start":{"character":7,"line":1887}},"targetUri":"f= ile:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rus= tlib/src/rust/library/core/src/option.rs"}],"id":1} 17:00:16 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 29, "jsonr= pc": "2.0", "result": ["//! Optional values.", "//!", "//! Type [`Option`] = represents an optional value: every [`Option`]", "//! is either [`Some`] an= d contains a value, or [`None`], and", "//! does not. [`Option`] types are = very common in Rust code, as", "//! they have a number of uses:", "//!", "/= /! * Initial values", "//! * Return values for functions that are not defin= ed", "//! over their entire input range (partial functions)", "//! * Retu= rn value for otherwise reporting simple errors, where [`None`] is", "//! = returned on error", "//! * Optional struct fields", "//! * Struct fields th= at can be loaned or \"taken\"", "//! * Optional function arguments", "//! *= Nullable pointers", "//! * Swapping things out of difficult situations", "= //!", "//! [`Option`]s are commonly paired with pattern matching to query t= he presence", "//! of a value and take action, always accounting for the [`= None`] case.", "//!", "//! ```", "//! fn divide(numerator: f64, denominator= : f64) -> Option {", "//! if denominator =3D=3D 0.0 {", "//! = None", "//! } else {", "//! Some(numerator / denominator)", = "//! }", "//! }", "//!", "//! // The return value of the function is an= option", "//! let result =3D divide(2.0, 3.0);", "//!", "//! // Pattern ma= tch to retrieve the value", "//! match result {", "//! // The division = was valid", "//! Some(x) =3D> println!(\"Result: {x}\"),", "//! // = The division was invalid", "//! None =3D> println!(\"Cannot divide b= y 0\"),", "//! }", "//! ```", "//!", "//", "// FIXME: Show how `Option` is = used in practice, with lots of methods", "//", "//! # Options and pointers = (\"nullable\" pointers)", "//!", "//! Rust's pointer types must always poin= t to a valid location; there are", "//! no \"null\" references. Instead, Ru= st has *optional* pointers, like", "//! the optional owned box, [Opti= on]<[Box\\]>.", "//!", "//! [Box\\]: ../../std/boxed/struct.Bo= x.html", "//!", "//! The following example uses [`Option`] to create an opt= ional box of", "//! [`i32`]. Notice that in order to use the inner [`i32`] = value, the", "//! `check_optional` function first needs to use pattern matc= hing to", "//! determine whether the box has a value (i.e., it is [`Some(..= .)`][`Some`]) or", "//! not ([`None`]).", "//!", "//! ```", "//! let option= al =3D None;", "//! check_optional(optional);", "//!", "//! let optional = =3D Some(Box::new(9000));", "//! check_optional(optional);", "//!", "//! fn= check_optional(optional: Option>) {", "//! match optional {",= "//! Some(p) =3D> println!(\"has value {p}\"),", "//! None= =3D> println!(\"has no value\"),", "//! }", "//! }", "//! ```", "//!",= "//! # Representation", "//!", "//! Rust guarantees to optimize the follow= ing types `T` such that", "//! [`Option`] has the same size as `T`:", "/= /!", "//! * [`Box`]", "//! * `&U`", "//! * `&mut U`", "//! * `fn`, `exte= rn \"C\" fn`[^extern_fn]", "//! * [`num::NonZero*`]", "//! * [`ptr::NonNull= `]", "//! * `#[repr(transparent)]` struct around one of the types in thi= s list.", "//!", "//! [^extern_fn]: this remains true for any other ABI: `e= xtern \"abi\" fn` (_e.g._, `extern \"system\" fn`)", "//!", "//! [`Box`]= : ../../std/boxed/struct.Box.html", "//! [`num::NonZero*`]: crate::num", "/= /! [`ptr::NonNull`]: crate::ptr::NonNull", "//!", "//! This is called th= e \"null pointer optimization\" or NPO.", "//!", "//! It is further guarant= eed that, for the cases above, one can", "//! [`mem::transmute`] from all v= alid values of `T` to `Option` and", "//! from `Some::(_)` to `T` (bu= t transmuting `None::` to `T`", "//! is undefined behaviour).", "//!", "= //! # Method overview", "//!", "//! In addition to working with pattern mat= ching, [`Option`] provides a wide", "//! variety of different methods.", "/= /!", "//! ## Querying the variant", "//!", "//! The [`is_some`] and [`is_no= ne`] methods return [`true`] if the [`Option`]", "//! is [`Some`] or [`None= `], respectively.", "//!", "//! [`is_none`]: Option::is_none", "//! [`is_so= me`]: Option::is_some", "//!", "//! ## Adapters for working with references= ", "//!", "//! * [`as_ref`] converts from [&][][Option]\\ t= o [Option]<[&]T>", "//! * [`as_mut`] converts from [&mut= ] [Option]\\ to [Option]<[&mut] T>", "//! * [`as_der= ef`] converts from [&][][Option]\\ to", "//! [Optio= n]<[&]T::[Target]>", "//! * [`as_deref_mut`] converts from [&m= ut] [Option]\\ to", "//! [Option]<[&mut] T::[Target]>", "//! * [`as_pin_ref`] converts from [Pin]<[&][][Option]\\> to", "//! [Option]<[Pin]<[&]T>>", "//! * [`as_pin_mut`= ] converts from [Pin]<[&mut] [Option]\\> to", "//! = [Option]<[Pin]<[&mut] T>>", "//!", "//! [&]: reference \"shared refe= rence\"", "//! [&mut]: reference \"mutable reference\"", "//! [Target]: Der= ef::Target \"ops::Deref::Target\"", "//! [`as_deref`]: Option::as_deref", "= //! [`as_deref_mut`]: Option::as_deref_mut", "//! [`as_mut`]: Option::as_mu= t", "//! [`as_pin_mut`]: Option::as_pin_mut", "//! [`as_pin_ref`]: Option::= as_pin_ref", "//! [`as_ref`]: Option::as_ref", "//!", "//! ## Extracting th= e contained value", "//!", "//! These methods extract the contained value i= n an [`Option`] when it", "//! is the [`Some`] variant. If the [`Option`= ] is [`None`]:", "//!", "//! * [`expect`] panics with a provided custom mes= sage", "//! * [`unwrap`] panics with a generic message", "//! * [`unwrap_or= `] returns the provided default value", "//! * [`unwrap_or_default`] return= s the default value of the type `T`", "//! (which must implement the [`De= fault`] trait)", "//! * [`unwrap_or_else`] returns the result of evaluating= the provided", "//! function", "//!", "//! [`expect`]: Option::expect", = "//! [`unwrap`]: Option::unwrap", "//! [`unwrap_or`]: Option::unwrap_or", "= //! [`unwrap_or_default`]: Option::unwrap_or_default", "//! [`unwrap_or_els= e`]: Option::unwrap_or_else", "//!", "//! ## Transforming contained values"= , "//!", "//! These methods transform [`Option`] to [`Result`]:", "//!", "/= /! * [`ok_or`] transforms [`Some(v)`] to [`Ok(v)`], and [`None`] to", "//! = [`Err(err)`] using the provided default `err` value", "//! * [`ok_or_else= `] transforms [`Some(v)`] to [`Ok(v)`], and [`None`] to", "//! a value of= [`Err`] using the provided function", "//! * [`transpose`] transposes an [= `Option`] of a [`Result`] into a", "//! [`Result`] of an [`Option`]", "//= !", "//! [`Err(err)`]: Err", "//! [`Ok(v)`]: Ok", "//! [`Some(v)`]: Some", = "//! [`ok_or`]: Option::ok_or", "//! [`ok_or_else`]: Option::ok_or_else", "= //! [`transpose`]: Option::transpose", "//!", "//! These methods transform = the [`Some`] variant:", "//!", "//! * [`filter`] calls the provided predica= te function on the contained", "//! value `t` if the [`Option`] is [`Some= (t)`], and returns [`Some(t)`]", "//! if the function returns `true`; oth= erwise, returns [`None`]", "//! * [`flatten`] removes one level of nesting = from an", "//! [`Option>`]", "//! * [`map`] transforms [`Option= `] to [`Option`] by applying the", "//! provided function to the co= ntained value of [`Some`] and leaving", "//! [`None`] values unchanged", = "//!", "//! [`Some(t)`]: Some", "//! [`filter`]: Option::filter", "//! [`fl= atten`]: Option::flatten", "//! [`map`]: Option::map", "//!", "//! These me= thods transform [`Option`] to a value of a possibly", "//! different typ= e `U`:", "//!", "//! * [`map_or`] applies the provided function to the cont= ained value of", "//! [`Some`], or returns the provided default value if = the [`Option`] is", "//! [`None`]", "//! * [`map_or_else`] applies the pr= ovided function to the contained value", "//! of [`Some`], or returns the= result of evaluating the provided", "//! fallback function if the [`Opti= on`] is [`None`]", "//!", "//! [`map_or`]: Option::map_or", "//! [`map_or_e= lse`]: Option::map_or_else", "//!", "//! These methods combine the [`Some`]= variants of two [`Option`] values:", "//!", "//! * [`zip`] returns [`Some(= (s, o))`] if `self` is [`Some(s)`] and the", "//! provided [`Option`] val= ue is [`Some(o)`]; otherwise, returns [`None`]", "//! * [`zip_with`] calls = the provided function `f` and returns", "//! [`Some(f(s, o))`] if `self` = is [`Some(s)`] and the provided", "//! [`Option`] value is [`Some(o)`]; o= therwise, returns [`None`]", "//!", "//! [`Some(f(s, o))`]: Some", "//! [`S= ome(o)`]: Some", "//! [`Some(s)`]: Some", "//! [`Some((s, o))`]: Some", "//= ! [`zip`]: Option::zip", "//! [`zip_with`]: Option::zip_with", "//!", "//! = ## Boolean operators", "//!", "//! These methods treat the [`Option`] as a = boolean value, where [`Some`]", "//! acts like [`true`] and [`None`] acts l= ike [`false`]. There are two", "//! categories of these methods: ones that = take an [`Option`] as input, and", "//! ones that take a function as input = (to be lazily evaluated).", "//!", "//! The [`and`], [`or`], and [`xor`] me= thods take another [`Option`] as", "//! input, and produce an [`Option`] as= output. Only the [`and`] method can", "//! produce an [`Option`] value = having a different inner type `U` than", "//! [`Option`].", "//!", "//! = | method | self | input | output |", "//! |---------|---------= --|-----------|-----------|", "//! | [`and`] | `None` | (ignored) | `Non= e` |", "//! | [`and`] | `Some(x)` | `None` | `None` |", "//! | [`a= nd`] | `Some(x)` | `Some(y)` | `Some(y)` |", "//! | [`or`] | `None` | `= None` | `None` |", "//! | [`or`] | `None` | `Some(y)` | `Some(y)`= |", "//! | [`or`] | `Some(x)` | (ignored) | `Some(x)` |", "//! | [`xor`] = | `None` | `None` | `None` |", "//! | [`xor`] | `None` | `Some(= y)` | `Some(y)` |", "//! | [`xor`] | `Some(x)` | `None` | `Some(x)` |", = "//! | [`xor`] | `Some(x)` | `Some(y)` | `None` |", "//!", "//! [`and`]:= Option::and", "//! [`or`]: Option::or", "//! [`xor`]: Option::xor", "//!",= "//! The [`and_then`] and [`or_else`] methods take a function as input, an= d", "//! only evaluate the function when they need to produce a new value. = Only", "//! the [`and_then`] method can produce an [`Option`] value havi= ng a", "//! different inner type `U` than [`Option`].", "//!", "//! | me= thod | self | function input | function result | output |", "= //! |--------------|-----------|----------------|-----------------|--------= ---|", "//! | [`and_then`] | `None` | (not provided) | (not evaluated) |= `None` |", "//! | [`and_then`] | `Some(x)` | `x` | `None` = | `None` |", "//! | [`and_then`] | `Some(x)` | `x` | `= Some(y)` | `Some(y)` |", "//! | [`or_else`] | `None` | (not provi= ded) | `None` | `None` |", "//! | [`or_else`] | `None` | (n= ot provided) | `Some(y)` | `Some(y)` |", "//! | [`or_else`] | `Some(= x)` | (not provided) | (not evaluated) | `Some(x)` |", "//!", "//! [`and_th= en`]: Option::and_then", "//! [`or_else`]: Option::or_else", "//!", "//! Th= is is an example of using methods like [`and_then`] and [`or`] in a", "//! = pipeline of method calls. Early stages of the pipeline pass failure", "//! = values ([`None`]) through unchanged, and continue processing on", "//! succ= ess values ([`Some`]). Toward the end, [`or`] substitutes an error", "//! m= essage if it receives [`None`].", "//!", "//! ```", "//! # use std::collect= ions::BTreeMap;", "//! let mut bt =3D BTreeMap::new();", "//! bt.insert(20u= 8, \"foo\");", "//! bt.insert(42u8, \"bar\");", "//! let res =3D [0u8, 1, 1= 1, 200, 22]", "//! .into_iter()", "//! .map(|x| {", "//! //= `checked_sub()` returns `None` on error", "//! x.checked_sub(1)", = "//! // same with `checked_mul()`", "//! .and_then(= |x| x.checked_mul(2))", "//! // `BTreeMap::get` returns `None` = on error", "//! .and_then(|x| bt.get(&x))", "//! //= Substitute an error message if we have `None` so far", "//! .o= r(Some(&\"error!\"))", "//! .copied()", "//! // Won= 't panic because we unconditionally used `Some` above", "//! .u= nwrap()", "//! })", "//! .collect::>();", "//! assert_eq!(re= s, [\"error!\", \"error!\", \"foo\", \"error!\", \"bar\"]);", "//! ```", "/= /!", "//! ## Comparison operators", "//!", "//! If `T` implements [`Partial= Ord`] then [`Option`] will derive its", "//! [`PartialOrd`] implementati= on. With this order, [`None`] compares as", "//! less than any [`Some`], a= nd two [`Some`] compare the same way as their", "//! contained values would= in `T`. If `T` also implements", "//! [`Ord`], then so does [`Option`]= .", "//!", "//! ```", "//! assert!(None < Some(0));", "//! assert!(Some(0) = < Some(1));", "//! ```", "//!", "//! ## Iterating over `Option`", "//!", "/= /! An [`Option`] can be iterated over. This can be helpful if you need an",= "//! iterator that is conditionally empty. The iterator will either produc= e", "//! a single value (when the [`Option`] is [`Some`]), or produce no va= lues", "//! (when the [`Option`] is [`None`]). For example, [`into_iter`] a= cts like", "//! [`once(v)`] if the [`Option`] is [`Some(v)`], and like [`em= pty()`] if", "//! the [`Option`] is [`None`].", "//!", "//! [`Some(v)`]: So= me", "//! [`empty()`]: crate::iter::empty", "//! [`once(v)`]: crate::iter::= once", "//!", "//! Iterators over [`Option`] come in three types:", "//!= ", "//! * [`into_iter`] consumes the [`Option`] and produces the contained"= , "//! value", "//! * [`iter`] produces an immutable reference of type `&= T` to the", "//! contained value", "//! * [`iter_mut`] produces a mutable= reference of type `&mut T` to the", "//! contained value", "//!", "//! [= `into_iter`]: Option::into_iter", "//! [`iter`]: Option::iter", "//! [`iter= _mut`]: Option::iter_mut", "//!", "//! An iterator over [`Option`] can be u= seful when chaining iterators, for", "//! example, to conditionally insert = items. (It's not always necessary to", "//! explicitly call an iterator con= structor: many [`Iterator`] methods that", "//! accept other iterators will= also accept iterable types that implement", "//! [`IntoIterator`], which i= ncludes [`Option`].)", "//!", "//! ```", "//! let yep =3D Some(42);", "//! = let nope =3D None;", "//! // chain() already calls into_iter(), so we don't= have to do so", "//! let nums: Vec =3D (0..4).chain(yep).chain(4..8).= collect();", "//! assert_eq!(nums, [0, 1, 2, 3, 42, 4, 5, 6, 7]);", "//! le= t nums: Vec =3D (0..4).chain(nope).chain(4..8).collect();", "//! asser= t_eq!(nums, [0, 1, 2, 3, 4, 5, 6, 7]);", "//! ```", "//!", "//! One reason = to chain iterators in this way is that a function returning", "//! `impl It= erator` must have all possible return values be of the same", "//! concrete= type. Chaining an iterated [`Option`] can help with that.", "//!", "//! ``= `", "//! fn make_iter(do_insert: bool) -> impl Iterator {", "= //! // Explicit returns to illustrate return types matching", "//! = match do_insert {", "//! true =3D> return (0..4).chain(Some(42)).ch= ain(4..8),", "//! false =3D> return (0..4).chain(None).chain(4..8),= ", "//! }", "//! }", "//! println!(\"{:?}\", make_iter(true).collect::<= Vec<_>>());", "//! println!(\"{:?}\", make_iter(false).collect::>())= ;", "//! ```", "//!", "//! If we try to do the same thing, but using [`once= ()`] and [`empty()`],", "//! we can't return `impl Iterator` anymore becaus= e the concrete types of", "//! the return values differ.", "//!", "//! [`em= pty()`]: crate::iter::empty", "//! [`once()`]: crate::iter::once", "//!", "= //! ```compile_fail,E0308", "//! # use std::iter::{empty, once};", "//! // = This won't compile because all possible returns from the function", "//! //= must have the same concrete type.", "//! fn make_iter(do_insert: bool) -> = impl Iterator {", "//! // Explicit returns to illustrate = return types not matching", "//! match do_insert {", "//! true = =3D> return (0..4).chain(once(42)).chain(4..8),", "//! false =3D> r= eturn (0..4).chain(empty()).chain(4..8),", "//! }", "//! }", "//! ```",= "//!", "//! ## Collecting into `Option`", "//!", "//! [`Option`] implement= s the [`FromIterator`][impl-FromIterator] trait,", "//! which allows an ite= rator over [`Option`] values to be collected into an", "//! [`Option`] of a= collection of each contained value of the original", "//! [`Option`] value= s, or [`None`] if any of the elements was [`None`].", "//!", "//! [impl-Fro= mIterator]: Option#impl-FromIterator%3COption%3CA%3E%3E", "//!", "//! ```",= "//! let v =3D [Some(2), Some(4), None, Some(8)];", "//! let res: Option> =3D v.into_iter().collect();", "//! assert_eq!(res, None);", "//! le= t v =3D [Some(2), Some(4), Some(8)];", "//! let res: Option> =3D v.i= nto_iter().collect();", "//! assert_eq!(res, Some(vec![2, 4, 8]));", "//! `= ``", "//!", "//! [`Option`] also implements the [`Product`][impl-Product] a= nd", "//! [`Sum`][impl-Sum] traits, allowing an iterator over [`Option`] va= lues", "//! to provide the [`product`][Iterator::product] and", "//! [`sum`= ][Iterator::sum] methods.", "//!", "//! [impl-Product]: Option#impl-Product= %3COption%3CU%3E%3E", "//! [impl-Sum]: Option#impl-Sum%3COption%3CU%3E%3E",= "//!", "//! ```", "//! let v =3D [None, Some(1), Some(2), Some(3)];", "//!= let res: Option =3D v.into_iter().sum();", "//! assert_eq!(res, None)= ;", "//! let v =3D [Some(1), Some(2), Some(21)];", "//! let res: Option =3D v.into_iter().product();", "//! assert_eq!(res, Some(42));", "//! ```= ", "//!", "//! ## Modifying an [`Option`] in-place", "//!", "//! These meth= ods return a mutable reference to the contained value of an", "//! [`Option= `]:", "//!", "//! * [`insert`] inserts a value, dropping any old content= s", "//! * [`get_or_insert`] gets the current value, inserting a provided",= "//! default value if it is [`None`]", "//! * [`get_or_insert_default`] = gets the current value, inserting the", "//! default value of type `T` (w= hich must implement [`Default`]) if it is", "//! [`None`]", "//! * [`get_= or_insert_with`] gets the current value, inserting a default", "//! compu= ted by the provided function if it is [`None`]", "//!", "//! [`get_or_inser= t`]: Option::get_or_insert", "//! [`get_or_insert_default`]: Option::get_or= _insert_default", "//! [`get_or_insert_with`]: Option::get_or_insert_with",= "//! [`insert`]: Option::insert", "//!", "//! These methods transfer owner= ship of the contained value of an", "//! [`Option`]:", "//!", "//! * [`take= `] takes ownership of the contained value of an [`Option`], if", "//! any= , replacing the [`Option`] with [`None`]", "//! * [`replace`] takes ownersh= ip of the contained value of an [`Option`],", "//! if any, replacing the = [`Option`] with a [`Some`] containing the", "//! provided value", "//!", = "//! [`replace`]: Option::replace", "//! [`take`]: Option::take", "//!", "/= /! # Examples", "//!", "//! Basic pattern matching on [`Option`]:", "//!", = "//! ```", "//! let msg =3D Some(\"howdy\");", "//!", "//! // Take a refere= nce to the contained string", "//! if let Some(m) =3D &msg {", "//! pri= ntln!(\"{}\", *m);", "//! }", "//!", "//! // Remove the contained string, d= estroying the Option", "//! let unwrapped_msg =3D msg.unwrap_or(\"default m= essage\");", "//! ```", "//!", "//! Initialize a result to [`None`] before = a loop:", "//!", "//! ```", "//! enum Kingdom { Plant(u32, &'static str), A= nimal(u32, &'static str) }", "//!", "//! // A list of data to search throug= h.", "//! let all_the_big_things =3D [", "//! Kingdom::Plant(250, \"red= wood\"),", "//! Kingdom::Plant(230, \"noble fir\"),", "//! Kingdom:= :Plant(229, \"sugar pine\"),", "//! Kingdom::Animal(25, \"blue whale\")= ,", "//! Kingdom::Animal(19, \"fin whale\"),", "//! Kingdom::Animal= (15, \"north pacific right whale\"),", "//! ];", "//!", "//! // We're going= to search for the name of the biggest animal,", "//! // but to start with = we've just got `None`.", "//! let mut name_of_biggest_animal =3D None;", "/= /! let mut size_of_biggest_animal =3D 0;", "//! for big_thing in &all_the_b= ig_things {", "//! match *big_thing {", "//! Kingdom::Animal(si= ze, name) if size > size_of_biggest_animal =3D> {", "//! // Now= we've found the name of some big animal", "//! size_of_biggest= _animal =3D size;", "//! name_of_biggest_animal =3D Some(name);= ", "//! }", "//! Kingdom::Animal(..) | Kingdom::Plant(..) = =3D> ()", "//! }", "//! }", "//!", "//! match name_of_biggest_animal {"= , "//! Some(name) =3D> println!(\"the biggest animal is {name}\"),", "/= /! None =3D> println!(\"there are no animals :(\"),", "//! }", "//! ```= ", "", "#![stable(feature =3D \"rust1\", since =3D \"1.0.0\")]", "", "use c= rate::iter::{self, FromIterator, FusedIterator, TrustedLen};", "use crate::= marker::Destruct;", "use crate::panicking::{panic, panic_str};", "use crate= ::pin::Pin;", "use crate::{", " convert, hint, mem,", " ops::{self, C= ontrolFlow, Deref, DerefMut},", "};", "", "/// The `Option` type. See [the = module level documentation](self) for more.", "#[derive(Copy, PartialEq, Pa= rtialOrd, Eq, Ord, Debug, Hash)]", "#[rustc_diagnostic_item =3D \"Option\"]= ", "#[stable(feature =3D \"rust1\", since =3D \"1.0.0\")]", "pub enum Optio= n {", " /// No value.", " #[lang =3D \"None\"]", " #[stable(fea= ture =3D \"rust1\", since =3D \"1.0.0\")]", " None,", " /// Some valu= e of type `T`.", " #[lang =3D \"Some\"]", " #[stable(feature =3D \"ru= st1\", since =3D \"1.0.0\")]", " Some(#[stable(feature =3D \"rust1\", si= nce =3D \"1.0.0\")] T),", "}", "", "///////////////////////////////////////= //////////////////////////////////////", "// Type implementation", "///////= //////////////////////////////////////////////////////////////////////", ""= , "impl Option {", " /////////////////////////////////////////////= ////////////////////////////", " // Querying the contained values", " = /////////////////////////////////////////////////////////////////////////"= , "", " /// Returns `true` if the option is a [`Some`] value.", " ///= ", " /// # Examples", " ///", " /// ```", " /// let x: Option =3D Some(2);", " /// assert_eq!(x.is_some(), true);", " ///", " = /// let x: Option =3D None;", " /// assert_eq!(x.is_some(), false= );", " /// ```", " #[must_use =3D \"if you intended to assert that th= is has a value, consider `.unwrap()` instead\"]", " #[inline]", " #[s= table(feature =3D \"rust1\", since =3D \"1.0.0\")]", " #[rustc_const_sta= ble(feature =3D \"const_option_basics\", since =3D \"1.48.0\")]", " pub = const fn is_some(&self) -> bool {", " matches!(*self, Some(_))", " = }", "", " /// Returns `true` if the option is a [`Some`] and the value= inside of it matches a predicate.", " ///", " /// # Examples", " = ///", " /// ```", " /// #![feature(is_some_with)]", " ///", " /= // let x: Option =3D Some(2);", " /// assert_eq!(x.is_some_and(|&x|= x > 1), true);", " ///", " /// let x: Option =3D Some(0);", " = /// assert_eq!(x.is_some_and(|&x| x > 1), false);", " ///", " /// l= et x: Option =3D None;", " /// assert_eq!(x.is_some_and(|&x| x > 1)= , false);", " /// ```", " #[must_use]", " #[inline]", " #[unsta= ble(feature =3D \"is_some_with\", issue =3D \"93050\")]", " pub fn is_so= me_and(&self, f: impl FnOnce(&T) -> bool) -> bool {", " matches!(sel= f, Some(x) if f(x))", " }", "", " /// Returns `true` if the option is= a [`None`] value.", " ///", " /// # Examples", " ///", " /// `= ``", " /// let x: Option =3D Some(2);", " /// assert_eq!(x.is_no= ne(), false);", " ///", " /// let x: Option =3D None;", " ///= assert_eq!(x.is_none(), true);", " /// ```", " #[must_use =3D \"if y= ou intended to assert that this doesn't have a value, consider \\", " = `.and_then(|_| panic!(\\\"`Option` had a value when expected `N= one`\\\"))` instead\"]", " #[inline]", " #[stable(feature =3D \"rust1= \", since =3D \"1.0.0\")]", " #[rustc_const_stable(feature =3D \"const_o= ption_basics\", since =3D \"1.48.0\")]", " pub const fn is_none(&self) -= > bool {", " !self.is_some()", " }", "", " ///////////////////= //////////////////////////////////////////////////////", " // Adapter fo= r working with references", " //////////////////////////////////////////= ///////////////////////////////", "", " /// Converts from `&Option` t= o `Option<&T>`.", " ///", " /// # Examples", " ///", " /// Conv= erts an Option<[String]> into an Option<[usize]>,= preserving", " /// the original. The [`map`] method takes the `self` ar= gument by value, consuming the original,", " /// so this technique uses = `as_ref` to first take an `Option` to a reference", " /// to the value i= nside the original.", " ///", " /// [`map`]: Option::map", " /// [= String]: ../../std/string/struct.String.html \"String\"", " ///", " /= // ```", " /// let text: Option =3D Some(\"Hello, world!\".to_st= ring());", " /// // First, cast `Option` to `Option<&String>` wi= th `as_ref`,", " /// // then consume *that* with `map`, leaving `text` o= n the stack.", " /// let text_length: Option =3D text.as_ref().ma= p(|s| s.len());", " /// println!(\"still can print text: {text:?}\");", = " /// ```", " #[inline]", " #[rustc_const_stable(feature =3D \"con= st_option_basics\", since =3D \"1.48.0\")]", " #[stable(feature =3D \"ru= st1\", since =3D \"1.0.0\")]", " pub const fn as_ref(&self) -> Option<&T= > {", " match *self {", " Some(ref x) =3D> Some(x),", " = None =3D> None,", " }", " }", "", " /// Converts fro= m `&mut Option` to `Option<&mut T>`.", " ///", " /// # Examples", = " ///", " /// ```", " /// let mut x =3D Some(2);", " /// match = x.as_mut() {", " /// Some(v) =3D> *v =3D 42,", " /// None =3D= > {},", " /// }", " /// assert_eq!(x, Some(42));", " /// ```", " = #[inline]", " #[stable(feature =3D \"rust1\", since =3D \"1.0.0\")]", = " #[rustc_const_unstable(feature =3D \"const_option\", issue =3D \"67441= \")]", " pub const fn as_mut(&mut self) -> Option<&mut T> {", " m= atch *self {", " Some(ref mut x) =3D> Some(x),", " No= ne =3D> None,", " }", " }", "", " /// Converts from [Pin= ]<[&]Option\\> to Option<[Pin]<[&]T>>.", " ///", = " /// [&]: reference \"shared reference\"", " #[inline]", " #[must= _use]", " #[stable(feature =3D \"pin\", since =3D \"1.33.0\")]", " #[= rustc_const_unstable(feature =3D \"const_option_ext\", issue =3D \"91930\")= ]", " pub const fn as_pin_ref(self: Pin<&Self>) -> Option> {", "= match Pin::get_ref(self).as_ref() {", " // SAFETY: `x` i= s guaranteed to be pinned because it comes from `self`", " // wh= ich is pinned.", " Some(x) =3D> unsafe { Some(Pin::new_unchecked= (x)) },", " None =3D> None,", " }", " }", "", " ///= Converts from [Pin]<[&mut] Option\\> to Option<[Pin]= <[&mut] T>>.", " ///", " /// [&mut]: reference \"mutable refer= ence\"", " #[inline]", " #[must_use]", " #[stable(feature =3D \"pi= n\", since =3D \"1.33.0\")]", " #[rustc_const_unstable(feature =3D \"con= st_option_ext\", issue =3D \"91930\")]", " pub const fn as_pin_mut(self:= Pin<&mut Self>) -> Option> {", " // SAFETY: `get_unchec= ked_mut` is never used to move the `Option` inside `self`.", " // `x= ` is guaranteed to be pinned because it comes from `self` which is pinned."= , " unsafe {", " match Pin::get_unchecked_mut(self).as_mu= t() {", " Some(x) =3D> Some(Pin::new_unchecked(x)),", " = None =3D> None,", " }", " }", " }", "", " = /////////////////////////////////////////////////////////////////////////= ", " // Getting to contained values", " /////////////////////////////= ////////////////////////////////////////////", "", " /// Returns the con= tained [`Some`] value, consuming the `self` value.", " ///", " /// # = Panics", " ///", " /// Panics if the value is a [`None`] with a custo= m panic message provided by", " /// `msg`.", " ///", " /// # Examp= les", " ///", " /// ```", " /// let x =3D Some(\"value\");", " = /// assert_eq!(x.expect(\"fruits are healthy\"), \"value\");", " /// ```= ", " ///", " /// ```should_panic", " /// let x: Option<&str> =3D N= one;", " /// x.expect(\"fruits are healthy\"); // panics with `fruits ar= e healthy`", " /// ```", " ///", " /// # Recommended Message Style= ", " ///", " /// We recommend that `expect` messages are used to desc= ribe the reason you", " /// _expect_ the `Option` should be `Some`.", " = ///", " /// ```should_panic", " /// # let slice: &[u8] =3D &[];", = " /// let item =3D slice.get(0)", " /// .expect(\"slice should no= t be empty\");", " /// ```", " ///", " /// **Hint**: If you're hav= ing trouble remembering how to phrase expect", " /// error messages reme= mber to focus on the word \"should\" as in \"env", " /// variable should= be set by blah\" or \"the given binary should be available", " /// and = executable by the current user\".", " ///", " /// For more detail on = expect message styles and the reasoning behind our", " /// recommendatio= n please refer to the section on [\"Common Message", " /// Styles\"](../= ../std/error/index.html#common-message-styles) in the [`std::error`](../../= std/error/index.html) module docs.", " #[inline]", " #[track_caller]"= , " #[stable(feature =3D \"rust1\", since =3D \"1.0.0\")]", " #[rustc= _const_unstable(feature =3D \"const_option\", issue =3D \"67441\")]", " = pub const fn expect(self, msg: &str) -> T {", " match self {", " = Some(val) =3D> val,", " None =3D> expect_failed(msg),", = " }", " }", "", " /// Returns the contained [`Some`] value, co= nsuming the `self` value.", " ///", " /// Because this function may p= anic, its use is generally discouraged.", " /// Instead, prefer to use p= attern matching and handle the [`None`]", " /// case explicitly, or call= [`unwrap_or`], [`unwrap_or_else`], or", " /// [`unwrap_or_default`].", = " ///", " /// [`unwrap_or`]: Option::unwrap_or", " /// [`unwrap_or= _else`]: Option::unwrap_or_else", " /// [`unwrap_or_default`]: Option::u= nwrap_or_default", " ///", " /// # Panics", " ///", " /// Panic= s if the self value equals [`None`].", " ///", " /// # Examples", " = ///", " /// ```", " /// let x =3D Some(\"air\");", " /// assert_= eq!(x.unwrap(), \"air\");", " /// ```", " ///", " /// ```should_pa= nic", " /// let x: Option<&str> =3D None;", " /// assert_eq!(x.unwrap= (), \"air\"); // fails", " /// ```", " #[inline]", " #[track_calle= r]", " #[stable(feature =3D \"rust1\", since =3D \"1.0.0\")]", " #[ru= stc_const_unstable(feature =3D \"const_option\", issue =3D \"67441\")]", " = pub const fn unwrap(self) -> T {", " match self {", " = Some(val) =3D> val,", " None =3D> panic(\"called `Option::unwrap= ()` on a `None` value\"),", " }", " }", "", " /// Returns the = contained [`Some`] value or a provided default.", " ///", " /// Argum= ents passed to `unwrap_or` are eagerly evaluated; if you are passing", " = /// the result of a function call, it is recommended to use [`unwrap_or_el= se`],", " /// which is lazily evaluated.", " ///", " /// [`unwrap_= or_else`]: Option::unwrap_or_else", " ///", " /// # Examples", " /= //", " /// ```", " /// assert_eq!(Some(\"car\").unwrap_or(\"bike\"), = \"car\");", " /// assert_eq!(None.unwrap_or(\"bike\"), \"bike\");", " = /// ```", " #[inline]", " #[stable(feature =3D \"rust1\", since =3D = \"1.0.0\")]", " #[rustc_const_unstable(feature =3D \"const_option_ext\",= issue =3D \"91930\")]", " pub const fn unwrap_or(self, default: T) -> T= ", " where", " T: ~const Destruct,", " {", " match self= {", " Some(x) =3D> x,", " None =3D> default,", " = }", " }", "", " /// Returns the contained [`Some`] value or compu= tes it from a closure.", " ///", " /// # Examples", " ///", " /= // ```", " /// let k =3D 10;", " /// assert_eq!(Some(4).unwrap_or_els= e(|| 2 * k), 4);", " /// assert_eq!(None.unwrap_or_else(|| 2 * k), 20);"= , " /// ```", " #[inline]", " #[stable(feature =3D \"rust1\", sinc= e =3D \"1.0.0\")]", " #[rustc_const_unstable(feature =3D \"const_option_= ext\", issue =3D \"91930\")]", " pub const fn unwrap_or_else(self, f:= F) -> T", " where", " F: ~const FnOnce() -> T,", " F: ~co= nst Destruct,", " {", " match self {", " Some(x) =3D> = x,", " None =3D> f(),", " }", " }", "", " /// Retur= ns the contained [`Some`] value or a default.", " ///", " /// Consume= s the `self` argument then, if [`Some`], returns the contained", " /// v= alue, otherwise if [`None`], returns the [default value] for that", " //= / type.", " ///", " /// # Examples", " ///", " /// Converts a s= tring to an integer, turning poorly-formed strings", " /// into 0 (the d= efault value for integers). [`parse`] converts", " /// a string to any o= ther type that implements [`FromStr`], returning", " /// [`None`] on err= or.", " ///", " /// ```", " /// let good_year_from_input =3D \"190= 9\";", " /// let bad_year_from_input =3D \"190blarg\";", " /// let go= od_year =3D good_year_from_input.parse().ok().unwrap_or_default();", " /= // let bad_year =3D bad_year_from_input.parse().ok().unwrap_or_default();",= " ///", " /// assert_eq!(1909, good_year);", " /// assert_eq!(0, = bad_year);", " /// ```", " ///", " /// [default value]: Default::d= efault", " /// [`parse`]: str::parse", " /// [`FromStr`]: crate::str:= :FromStr", " #[inline]", " #[stable(feature =3D \"rust1\", since =3D = \"1.0.0\")]", " #[rustc_const_unstable(feature =3D \"const_option_ext\",= issue =3D \"91930\")]", " pub const fn unwrap_or_default(self) -> T", "= where", " T: ~const Default,", " {", " match self {", = " Some(x) =3D> x,", " None =3D> Default::default(),",= " }", " }", "", " /// Returns the contained [`Some`] value, c= onsuming the `self` value,", " /// without checking that the value is no= t [`None`].", " ///", " /// # Safety", " ///", " /// Calling th= is method on [`None`] is *[undefined behavior]*.", " ///", " /// [und= efined behavior]: https://doc.rust-lang.org/reference/behavior-considered-u= ndefined.html", " ///", " /// # Examples", " ///", " /// ```", = " /// let x =3D Some(\"air\");", " /// assert_eq!(unsafe { x.unwrap_u= nchecked() }, \"air\");", " /// ```", " ///", " /// ```no_run", " = /// let x: Option<&str> =3D None;", " /// assert_eq!(unsafe { x.unwra= p_unchecked() }, \"air\"); // Undefined behavior!", " /// ```", " #[i= nline]", " #[track_caller]", " #[stable(feature =3D \"option_result_u= nwrap_unchecked\", since =3D \"1.58.0\")]", " #[rustc_const_unstable(fea= ture =3D \"const_option_ext\", issue =3D \"91930\")]", " pub const unsaf= e fn unwrap_unchecked(self) -> T {", " debug_assert!(self.is_some())= ;", " match self {", " Some(val) =3D> val,", " = // SAFETY: the safety contract must be upheld by the caller.", " = None =3D> unsafe { hint::unreachable_unchecked() },", " }", " }= ", "", " ///////////////////////////////////////////////////////////////= //////////", " // Transforming contained values", " /////////////////= ////////////////////////////////////////////////////////", "", " /// Map= s an `Option` to `Option` by applying a function to a contained value= .", " ///", " /// # Examples", " ///", " /// Converts an = Option<[String]> into an Option<[usize]>, consuming", "= /// the original:", " ///", " /// [String]: ../../std/string/stru= ct.String.html \"String\"", " /// ```", " /// let maybe_some_string = =3D Some(String::from(\"Hello, World!\"));", " /// // `Option::map` take= s self *by value*, consuming `maybe_some_string`", " /// let maybe_some_= len =3D maybe_some_string.map(|s| s.len());", " ///", " /// assert_eq= !(maybe_some_len, Some(13));", " /// ```", " #[inline]", " #[stabl= e(feature =3D \"rust1\", since =3D \"1.0.0\")]", " #[rustc_const_unstabl= e(feature =3D \"const_option_ext\", issue =3D \"91930\")]", " pub const = fn map(self, f: F) -> Option", " where", " F: ~const FnO= nce(T) -> U,", " F: ~const Destruct,", " {", " match self = {", " Some(x) =3D> Some(f(x)),", " None =3D> None,", = " }", " }", "", " /// Calls the provided closure with a refere= nce to the contained value (if [`Some`]).", " ///", " /// # Examples"= , " ///", " /// ```", " /// #![feature(result_option_inspect)]", "= ///", " /// let v =3D vec![1, 2, 3, 4, 5];", " ///", " /// // = prints \"got: 4\"", " /// let x: Option<&usize> =3D v.get(3).inspect(|x|= println!(\"got: {x}\"));", " ///", " /// // prints nothing", " //= / let x: Option<&usize> =3D v.get(5).inspect(|x| println!(\"got: {x}\"));",= " /// ```", " #[inline]", " #[unstable(feature =3D \"result_optio= n_inspect\", issue =3D \"91345\")]", " #[rustc_const_unstable(feature = =3D \"const_option_ext\", issue =3D \"91930\")]", " pub const fn inspect= (self, f: F) -> Self", " where", " F: ~const FnOnce(&T),", " = F: ~const Destruct,", " {", " if let Some(ref x) =3D self {= ", " f(x);", " }", "", " self", " }", "", " = /// Returns the provided default result (if none),", " /// or applies a = function to the contained value (if any).", " ///", " /// Arguments p= assed to `map_or` are eagerly evaluated; if you are passing", " /// the = result of a function call, it is recommended to use [`map_or_else`],", " = /// which is lazily evaluated.", " ///", " /// [`map_or_else`]: Opti= on::map_or_else", " ///", " /// # Examples", " ///", " /// ```"= , " /// let x =3D Some(\"foo\");", " /// assert_eq!(x.map_or(42, |v| = v.len()), 3);", " ///", " /// let x: Option<&str> =3D None;", " //= / assert_eq!(x.map_or(42, |v| v.len()), 42);", " /// ```", " #[inline= ]", " #[stable(feature =3D \"rust1\", since =3D \"1.0.0\")]", " #[rus= tc_const_unstable(feature =3D \"const_option_ext\", issue =3D \"91930\")]",= " pub const fn map_or(self, default: U, f: F) -> U", " where",= " F: ~const FnOnce(T) -> U,", " F: ~const Destruct,", " = U: ~const Destruct,", " {", " match self {", " Some= (t) =3D> f(t),", " None =3D> default,", " }", " }", ""= , " /// Computes a default function result (if none), or", " /// appl= ies a different function to the contained value (if any).", " ///", " = /// # Examples", " ///", " /// ```", " /// let k =3D 21;", " /= //", " /// let x =3D Some(\"foo\");", " /// assert_eq!(x.map_or_else(= || 2 * k, |v| v.len()), 3);", " ///", " /// let x: Option<&str> =3D N= one;", " /// assert_eq!(x.map_or_else(|| 2 * k, |v| v.len()), 42);", " = /// ```", " #[inline]", " #[stable(feature =3D \"rust1\", since =3D= \"1.0.0\")]", " #[rustc_const_unstable(feature =3D \"const_option_ext\"= , issue =3D \"91930\")]", " pub const fn map_or_else(self, defa= ult: D, f: F) -> U", " where", " D: ~const FnOnce() -> U,", " = D: ~const Destruct,", " F: ~const FnOnce(T) -> U,", " F: = ~const Destruct,", " {", " match self {", " Some(t) = =3D> f(t),", " None =3D> default(),", " }", " }", "", = " /// Transforms the `Option` into a [`Result`], mapping [`Some= (v)`] to", " /// [`Ok(v)`] and [`None`] to [`Err(err)`].", " ///", " = /// Arguments passed to `ok_or` are eagerly evaluated; if you are passin= g the", " /// result of a function call, it is recommended to use [`ok_o= r_else`], which is", " /// lazily evaluated.", " ///", " /// [`Ok(= v)`]: Ok", " /// [`Err(err)`]: Err", " /// [`Some(v)`]: Some", " /= // [`ok_or_else`]: Option::ok_or_else", " ///", " /// # Examples", " = ///", " /// ```", " /// let x =3D Some(\"foo\");", " /// assert= _eq!(x.ok_or(0), Ok(\"foo\"));", " ///", " /// let x: Option<&str> = =3D None;", " /// assert_eq!(x.ok_or(0), Err(0));", " /// ```", " = #[inline]", " #[stable(feature =3D \"rust1\", since =3D \"1.0.0\")]", " = #[rustc_const_unstable(feature =3D \"const_option_ext\", issue =3D \"919= 30\")]", " pub const fn ok_or(self, err: E) -> Result", " wh= ere", " E: ~const Destruct,", " {", " match self {", " = Some(v) =3D> Ok(v),", " None =3D> Err(err),", " }= ", " }", "", " /// Transforms the `Option` into a [`Result`]= , mapping [`Some(v)`] to", " /// [`Ok(v)`] and [`None`] to [`Err(err())`= ].", " ///", " /// [`Ok(v)`]: Ok", " /// [`Err(err())`]: Err", " = /// [`Some(v)`]: Some", " ///", " /// # Examples", " ///", " = /// ```", " /// let x =3D Some(\"foo\");", " /// assert_eq!(x.ok_or_e= lse(|| 0), Ok(\"foo\"));", " ///", " /// let x: Option<&str> =3D None= ;", " /// assert_eq!(x.ok_or_else(|| 0), Err(0));", " /// ```", " = #[inline]", " #[stable(feature =3D \"rust1\", since =3D \"1.0.0\")]", " = #[rustc_const_unstable(feature =3D \"const_option_ext\", issue =3D \"919= 30\")]", " pub const fn ok_or_else(self, err: F) -> Result",= " where", " F: ~const FnOnce() -> E,", " F: ~const Destru= ct,", " {", " match self {", " Some(v) =3D> Ok(v),", "= None =3D> Err(err()),", " }", " }", "", " /// Conv= erts from `Option` (or `&Option`) to `Option<&T::Target>`.", " ///= ", " /// Leaves the original Option in-place, creating a new one with a = reference", " /// to the original one, additionally coercing the content= s via [`Deref`].", " ///", " /// # Examples", " ///", " /// ```= ", " /// let x: Option =3D Some(\"hey\".to_owned());", " /// = assert_eq!(x.as_deref(), Some(\"hey\"));", " ///", " /// let x: Optio= n =3D None;", " /// assert_eq!(x.as_deref(), None);", " /// `= ``", " #[stable(feature =3D \"option_deref\", since =3D \"1.40.0\")]", "= #[rustc_const_unstable(feature =3D \"const_option_ext\", issue =3D \"91= 930\")]", " pub const fn as_deref(&self) -> Option<&T::Target>", " wh= ere", " T: ~const Deref,", " {", " match self.as_ref() {",= " Some(t) =3D> Some(t.deref()),", " None =3D> None,"= , " }", " }", "", " /// Converts from `Option` (or `&mut Op= tion`) to `Option<&mut T::Target>`.", " ///", " /// Leaves the ori= ginal `Option` in-place, creating a new one containing a mutable reference = to", " /// the inner type's [`Deref::Target`] type.", " ///", " //= / # Examples", " ///", " /// ```", " /// let mut x: Option= =3D Some(\"hey\".to_owned());", " /// assert_eq!(x.as_deref_mut().map(|= x| {", " /// x.make_ascii_uppercase();", " /// x", " /// }= ), Some(\"HEY\".to_owned().as_mut_str()));", " /// ```", " #[stable(f= eature =3D \"option_deref\", since =3D \"1.40.0\")]", " #[rustc_const_un= stable(feature =3D \"const_option_ext\", issue =3D \"91930\")]", " pub c= onst fn as_deref_mut(&mut self) -> Option<&mut T::Target>", " where", " = T: ~const DerefMut,", " {", " match self.as_mut() {", " = Some(t) =3D> Some(t.deref_mut()),", " None =3D> None,",= " }", " }", "", " ///////////////////////////////////////////= //////////////////////////////", " // Iterator constructors", " /////= ////////////////////////////////////////////////////////////////////", "", = " /// Returns an iterator over the possibly contained value.", " ///"= , " /// # Examples", " ///", " /// ```", " /// let x =3D Some(4= );", " /// assert_eq!(x.iter().next(), Some(&4));", " ///", " /// = let x: Option =3D None;", " /// assert_eq!(x.iter().next(), None);"= , " /// ```", " #[inline]", " #[rustc_const_unstable(feature =3D \= "const_option\", issue =3D \"67441\")]", " #[stable(feature =3D \"rust1\= ", since =3D \"1.0.0\")]", " pub const fn iter(&self) -> Iter<'_, T> {",= " Iter { inner: Item { opt: self.as_ref() } }", " }", "", " /= // Returns a mutable iterator over the possibly contained value.", " ///= ", " /// # Examples", " ///", " /// ```", " /// let mut x =3D S= ome(4);", " /// match x.iter_mut().next() {", " /// Some(v) =3D> = *v =3D 42,", " /// None =3D> {},", " /// }", " /// assert_eq!(= x, Some(42));", " ///", " /// let mut x: Option =3D None;", " = /// assert_eq!(x.iter_mut().next(), None);", " /// ```", " #[inline]= ", " #[stable(feature =3D \"rust1\", since =3D \"1.0.0\")]", " pub fn= iter_mut(&mut self) -> IterMut<'_, T> {", " IterMut { inner: Item {= opt: self.as_mut() } }", " }", "", " ///////////////////////////////= //////////////////////////////////////////", " // Boolean operations on = the values, eager and lazy", " /////////////////////////////////////////= ////////////////////////////////", "", " /// Returns [`None`] if the opt= ion is [`None`], otherwise returns `optb`.", " ///", " /// # Examples= ", " ///", " /// ```", " /// let x =3D Some(2);", " /// let y: = Option<&str> =3D None;", " /// assert_eq!(x.and(y), None);", " ///", = " /// let x: Option =3D None;", " /// let y =3D Some(\"foo\");",= " /// assert_eq!(x.and(y), None);", " ///", " /// let x =3D Some(= 2);", " /// let y =3D Some(\"foo\");", " /// assert_eq!(x.and(y), Som= e(\"foo\"));", " ///", " /// let x: Option =3D None;", " /// = let y: Option<&str> =3D None;", " /// assert_eq!(x.and(y), None);", " = /// ```", " #[inline]", " #[stable(feature =3D \"rust1\", since =3D = \"1.0.0\")]", " #[rustc_const_unstable(feature =3D \"const_option_ext\",= issue =3D \"91930\")]", " pub const fn and(self, optb: Option) ->= Option", " where", " T: ~const Destruct,", " U: ~const= Destruct,", " {", " match self {", " Some(_) =3D> opt= b,", " None =3D> None,", " }", " }", "", " /// Retu= rns [`None`] if the option is [`None`], otherwise calls `f` with the", " = /// wrapped value and returns the result.", " ///", " /// Some langu= ages call this operation flatmap.", " ///", " /// # Examples", " /= //", " /// ```", " /// fn sq_then_to_string(x: u32) -> Option= {", " /// x.checked_mul(x).map(|sq| sq.to_string())", " /// }", = " ///", " /// assert_eq!(Some(2).and_then(sq_then_to_string), Some(4.= to_string()));", " /// assert_eq!(Some(1_000_000).and_then(sq_then_to_st= ring), None); // overflowed!", " /// assert_eq!(None.and_then(sq_then_to= _string), None);", " /// ```", " ///", " /// Often used to chain f= allible operations that may return [`None`].", " ///", " /// ```", " = /// let arr_2d =3D [[\"A0\", \"A1\"], [\"B0\", \"B1\"]];", " ///", " = /// let item_0_1 =3D arr_2d.get(0).and_then(|row| row.get(1));", " //= / assert_eq!(item_0_1, Some(&\"A1\"));", " ///", " /// let item_2_0 = =3D arr_2d.get(2).and_then(|row| row.get(0));", " /// assert_eq!(item_2_= 0, None);", " /// ```", " #[inline]", " #[stable(feature =3D \"rus= t1\", since =3D \"1.0.0\")]", " #[rustc_const_unstable(feature =3D \"con= st_option_ext\", issue =3D \"91930\")]", " pub const fn and_then(s= elf, f: F) -> Option", " where", " F: ~const FnOnce(T) -> Opti= on,", " F: ~const Destruct,", " {", " match self {", " = Some(x) =3D> f(x),", " None =3D> None,", " }",= " }", "", " /// Returns [`None`] if the option is [`None`], otherwis= e calls `predicate`", " /// with the wrapped value and returns:", " /= //", " /// - [`Some(t)`] if `predicate` returns `true` (where `t` is the= wrapped", " /// value), and", " /// - [`None`] if `predicate` retu= rns `false`.", " ///", " /// This function works similar to [`Iterato= r::filter()`]. You can imagine", " /// the `Option` being an iterator= over one or zero elements. `filter()`", " /// lets you decide which ele= ments to keep.", " ///", " /// # Examples", " ///", " /// ```ru= st", " /// fn is_even(n: &i32) -> bool {", " /// n % 2 =3D=3D 0",= " /// }", " ///", " /// assert_eq!(None.filter(is_even), None);",= " /// assert_eq!(Some(3).filter(is_even), None);", " /// assert_eq!(= Some(4).filter(is_even), Some(4));", " /// ```", " ///", " /// [`S= ome(t)`]: Some", " #[inline]", " #[stable(feature =3D \"option_filter= \", since =3D \"1.27.0\")]", " #[rustc_const_unstable(feature =3D \"cons= t_option_ext\", issue =3D \"91930\")]", " pub const fn filter

(self, p= redicate: P) -> Self", " where", " T: ~const Destruct,", " = P: ~const FnOnce(&T) -> bool,", " P: ~const Destruct,", " {", " = if let Some(x) =3D self {", " if predicate(&x) {", " = return Some(x);", " }", " }", " None", = " }", "", " /// Returns the option if it contains a value, otherwise = returns `optb`.", " ///", " /// Arguments passed to `or` are eagerly = evaluated; if you are passing the", " /// result of a function call, it = is recommended to use [`or_else`], which is", " /// lazily evaluated.", = " ///", " /// [`or_else`]: Option::or_else", " ///", " /// # Ex= amples", " ///", " /// ```", " /// let x =3D Some(2);", " /// l= et y =3D None;", " /// assert_eq!(x.or(y), Some(2));", " ///", " /= // let x =3D None;", " /// let y =3D Some(100);", " /// assert_eq!(x.= or(y), Some(100));", " ///", " /// let x =3D Some(2);", " /// let = y =3D Some(100);", " /// assert_eq!(x.or(y), Some(2));", " ///", " = /// let x: Option =3D None;", " /// let y =3D None;", " /// ass= ert_eq!(x.or(y), None);", " /// ```", " #[inline]", " #[stable(fea= ture =3D \"rust1\", since =3D \"1.0.0\")]", " #[rustc_const_unstable(fea= ture =3D \"const_option_ext\", issue =3D \"91930\")]", " pub const fn or= (self, optb: Option) -> Option", " where", " T: ~const Dest= ruct,", " {", " match self {", " Some(x) =3D> Some(x),= ", " None =3D> optb,", " }", " }", "", " /// Return= s the option if it contains a value, otherwise calls `f` and", " /// ret= urns the result.", " ///", " /// # Examples", " ///", " /// ```= ", " /// fn nobody() -> Option<&'static str> { None }", " /// fn viki= ngs() -> Option<&'static str> { Some(\"vikings\") }", " ///", " /// a= ssert_eq!(Some(\"barbarians\").or_else(vikings), Some(\"barbarians\"));", "= /// assert_eq!(None.or_else(vikings), Some(\"vikings\"));", " /// as= sert_eq!(None.or_else(nobody), None);", " /// ```", " #[inline]", " = #[stable(feature =3D \"rust1\", since =3D \"1.0.0\")]", " #[rustc_cons= t_unstable(feature =3D \"const_option_ext\", issue =3D \"91930\")]", " p= ub const fn or_else(self, f: F) -> Option", " where", " F: = ~const FnOnce() -> Option,", " F: ~const Destruct,", " {", " = match self {", " Some(x) =3D> Some(x),", " None= =3D> f(),", " }", " }", "", " /// Returns [`Some`] if exactly= one of `self`, `optb` is [`Some`], otherwise returns [`None`].", " ///"= , " /// # Examples", " ///", " /// ```", " /// let x =3D Some(2= );", " /// let y: Option =3D None;", " /// assert_eq!(x.xor(y), = Some(2));", " ///", " /// let x: Option =3D None;", " /// let= y =3D Some(2);", " /// assert_eq!(x.xor(y), Some(2));", " ///", " = /// let x =3D Some(2);", " /// let y =3D Some(2);", " /// assert_eq!= (x.xor(y), None);", " ///", " /// let x: Option =3D None;", " = /// let y: Option =3D None;", " /// assert_eq!(x.xor(y), None);", = " /// ```", " #[inline]", " #[stable(feature =3D \"option_xor\", s= ince =3D \"1.37.0\")]", " #[rustc_const_unstable(feature =3D \"const_opt= ion_ext\", issue =3D \"91930\")]", " pub const fn xor(self, optb: Option= ) -> Option", " where", " T: ~const Destruct,", " {", " = match (self, optb) {", " (Some(a), None) =3D> Some(a),", = " (None, Some(b)) =3D> Some(b),", " _ =3D> None,", " = }", " }", "", " //////////////////////////////////////////////= ///////////////////////////", " // Entry-like operations to insert a val= ue and return a reference", " //////////////////////////////////////////= ///////////////////////////////", "", " /// Inserts `value` into the opt= ion, then returns a mutable reference to it.", " ///", " /// If the o= ption already contains a value, the old value is dropped.", " ///", " = /// See also [`Option::get_or_insert`], which doesn't update the value if"= , " /// the option already contains [`Some`].", " ///", " /// # Ex= ample", " ///", " /// ```", " /// let mut opt =3D None;", " ///= let val =3D opt.insert(1);", " /// assert_eq!(*val, 1);", " /// asse= rt_eq!(opt.unwrap(), 1);", " /// let val =3D opt.insert(2);", " /// a= ssert_eq!(*val, 2);", " /// *val =3D 3;", " /// assert_eq!(opt.unwrap= (), 3);", " /// ```", " #[must_use =3D \"if you intended to set a val= ue, consider assignment instead\"]", " #[inline]", " #[stable(feature= =3D \"option_insert\", since =3D \"1.53.0\")]", " #[rustc_const_unstabl= e(feature =3D \"const_option_ext\", issue =3D \"91930\")]", " pub const = fn insert(&mut self, value: T) -> &mut T", " where", " T: ~const = Destruct,", " {", " *self =3D Some(value);", "", " // SAFE= TY: the code above just filled the option", " unsafe { self.as_mut()= .unwrap_unchecked() }", " }", "", " /// Inserts `value` into the opti= on if it is [`None`], then", " /// returns a mutable reference to the co= ntained value.", " ///", " /// See also [`Option::insert`], which upd= ates the value even if", " /// the option already contains [`Some`].", "= ///", " /// # Examples", " ///", " /// ```", " /// let mut = x =3D None;", " ///", " /// {", " /// let y: &mut u32 =3D x.ge= t_or_insert(5);", " /// assert_eq!(y, &5);", " ///", " /// = *y =3D 7;", " /// }", " ///", " /// assert_eq!(x, Some(7));", " = /// ```", " #[inline]", " #[stable(feature =3D \"option_entry\", si= nce =3D \"1.20.0\")]", " #[rustc_const_unstable(feature =3D \"const_opti= on_ext\", issue =3D \"91930\")]", " pub const fn get_or_insert(&mut self= , value: T) -> &mut T", " where", " T: ~const Destruct,", " {"= , " if let None =3D *self {", " *self =3D Some(value);", = " }", "", " // SAFETY: a `None` variant for `self` would have= been replaced by a `Some`", " // variant in the code above.", " = unsafe { self.as_mut().unwrap_unchecked() }", " }", "", " /// Ins= erts the default value into the option if it is [`None`], then", " /// r= eturns a mutable reference to the contained value.", " ///", " /// # = Examples", " ///", " /// ```", " /// #![feature(option_get_or_inse= rt_default)]", " ///", " /// let mut x =3D None;", " ///", " //= / {", " /// let y: &mut u32 =3D x.get_or_insert_default();", " //= / assert_eq!(y, &0);", " ///", " /// *y =3D 7;", " /// }",= " ///", " /// assert_eq!(x, Some(7));", " /// ```", " #[inline= ]", " #[unstable(feature =3D \"option_get_or_insert_default\", issue =3D= \"82901\")]", " #[rustc_const_unstable(feature =3D \"const_option_ext\"= , issue =3D \"91930\")]", " pub const fn get_or_insert_default(&mut self= ) -> &mut T", " where", " T: ~const Default,", " {", " = const fn default() -> T {", " T::default()", = " }", "", " self.get_or_insert_with(default)", " }", "", "= /// Inserts a value computed from `f` into the option if it is [`None`]= ,", " /// then returns a mutable reference to the contained value.", " = ///", " /// # Examples", " ///", " /// ```", " /// let mut x = =3D None;", " ///", " /// {", " /// let y: &mut u32 =3D x.get_= or_insert_with(|| 5);", " /// assert_eq!(y, &5);", " ///", " /= // *y =3D 7;", " /// }", " ///", " /// assert_eq!(x, Some(7));= ", " /// ```", " #[inline]", " #[stable(feature =3D \"option_entry= \", since =3D \"1.20.0\")]", " #[rustc_const_unstable(feature =3D \"cons= t_option_ext\", issue =3D \"91930\")]", " pub const fn get_or_insert_wit= h(&mut self, f: F) -> &mut T", " where", " F: ~const FnOnce() = -> T,", " F: ~const Destruct,", " {", " if let None =3D *s= elf {", " // the compiler isn't smart enough to know that we are= not dropping a `T`", " // here and wants us to ensure `T` can b= e dropped at compile time.", " mem::forget(mem::replace(self, So= me(f())))", " }", "", " // SAFETY: a `None` variant for `self= ` would have been replaced by a `Some`", " // variant in the code ab= ove.", " unsafe { self.as_mut().unwrap_unchecked() }", " }", "", = " //////////////////////////////////////////////////////////////////////= ///", " // Misc", " /////////////////////////////////////////////////= ////////////////////////", "", " /// Takes the value out of the option, = leaving a [`None`] in its place.", " ///", " /// # Examples", " //= /", " /// ```", " /// let mut x =3D Some(2);", " /// let y =3D x.t= ake();", " /// assert_eq!(x, None);", " /// assert_eq!(y, Some(2));",= " ///", " /// let mut x: Option =3D None;", " /// let y =3D = x.take();", " /// assert_eq!(x, None);", " /// assert_eq!(y, None);",= " /// ```", " #[inline]", " #[stable(feature =3D \"rust1\", since= =3D \"1.0.0\")]", " #[rustc_const_unstable(feature =3D \"const_option\"= , issue =3D \"67441\")]", " pub const fn take(&mut self) -> Option {"= , " // FIXME replace `mem::replace` by `mem::take` when the latter i= s const ready", " mem::replace(self, None)", " }", "", " /// R= eplaces the actual value in the option by the value given in parameter,", "= /// returning the old value if present,", " /// leaving a [`Some`] i= n its place without deinitializing either one.", " ///", " /// # Exam= ples", " ///", " /// ```", " /// let mut x =3D Some(2);", " ///= let old =3D x.replace(5);", " /// assert_eq!(x, Some(5));", " /// as= sert_eq!(old, Some(2));", " ///", " /// let mut x =3D None;", " //= / let old =3D x.replace(3);", " /// assert_eq!(x, Some(3));", " /// a= ssert_eq!(old, None);", " /// ```", " #[inline]", " #[rustc_const_= unstable(feature =3D \"const_option\", issue =3D \"67441\")]", " #[stabl= e(feature =3D \"option_replace\", since =3D \"1.31.0\")]", " pub const f= n replace(&mut self, value: T) -> Option {", " mem::replace(self,= Some(value))", " }", "", " /// Returns `true` if the option is a [`S= ome`] value containing the given value.", " ///", " /// # Examples", = " ///", " /// ```", " /// #![feature(option_result_contains)]", " = ///", " /// let x: Option =3D Some(2);", " /// assert_eq!(x.c= ontains(&2), true);", " ///", " /// let x: Option =3D Some(3);",= " /// assert_eq!(x.contains(&2), false);", " ///", " /// let x: O= ption =3D None;", " /// assert_eq!(x.contains(&2), false);", " /= // ```", " #[must_use]", " #[inline]", " #[unstable(feature =3D \"= option_result_contains\", issue =3D \"62358\")]", " #[rustc_const_unstab= le(feature =3D \"const_option_ext\", issue =3D \"91930\")]", " pub const= fn contains(&self, x: &U) -> bool", " where", " U: ~const Par= tialEq,", " {", " match self {", " Some(y) =3D> x.e= q(y),", " None =3D> false,", " }", " }", "", " /// = Zips `self` with another `Option`.", " ///", " /// If `self` is `Some= (s)` and `other` is `Some(o)`, this method returns `Some((s, o))`.", " /= // Otherwise, `None` is returned.", " ///", " /// # Examples", " /= //", " /// ```", " /// let x =3D Some(1);", " /// let y =3D Some(\= "hi\");", " /// let z =3D None::;", " ///", " /// assert_eq!(x= .zip(y), Some((1, \"hi\")));", " /// assert_eq!(x.zip(z), None);", " = /// ```", " #[stable(feature =3D \"option_zip_option\", since =3D \"1.46= .0\")]", " #[rustc_const_unstable(feature =3D \"const_option_ext\", issu= e =3D \"91930\")]", " pub const fn zip(self, other: Option) -> Opt= ion<(T, U)>", " where", " T: ~const Destruct,", " U: ~cons= t Destruct,", " {", " match (self, other) {", " (Some(= a), Some(b)) =3D> Some((a, b)),", " _ =3D> None,", " }", = " }", "", " /// Zips `self` and another `Option` with function `f`.",= " ///", " /// If `self` is `Some(s)` and `other` is `Some(o)`, this = method returns `Some(f(s, o))`.", " /// Otherwise, `None` is returned.",= " ///", " /// # Examples", " ///", " /// ```", " /// #![fea= ture(option_zip)]", " ///", " /// #[derive(Debug, PartialEq)]", " = /// struct Point {", " /// x: f64,", " /// y: f64,", " ///= }", " ///", " /// impl Point {", " /// fn new(x: f64, y: f64)= -> Self {", " /// Self { x, y }", " /// }", " /// }",= " ///", " /// let x =3D Some(17.5);", " /// let y =3D Some(42.7);= ", " ///", " /// assert_eq!(x.zip_with(y, Point::new), Some(Point { x= : 17.5, y: 42.7 }));", " /// assert_eq!(x.zip_with(None, Point::new), No= ne);", " /// ```", " #[unstable(feature =3D \"option_zip\", issue =3D= \"70086\")]", " #[rustc_const_unstable(feature =3D \"const_option_ext\"= , issue =3D \"91930\")]", " pub const fn zip_with(self, other: = Option, f: F) -> Option", " where", " F: ~const FnOnce(T, U= ) -> R,", " F: ~const Destruct,", " T: ~const Destruct,", " = U: ~const Destruct,", " {", " match (self, other) {", " = (Some(a), Some(b)) =3D> Some(f(a, b)),", " _ =3D> None,"= , " }", " }", "}", "", "impl Option<(T, U)> {", " /// Un= zips an option containing a tuple of two options.", " ///", " /// If = `self` is `Some((a, b))` this method returns `(Some(a), Some(b))`.", " /= // Otherwise, `(None, None)` is returned.", " ///", " /// # Examples"= , " ///", " /// ```", " /// #![feature(unzip_option)]", " ///",= " /// let x =3D Some((1, \"hi\"));", " /// let y =3D None::<(u8, u32= )>;", " ///", " /// assert_eq!(x.unzip(), (Some(1), Some(\"hi\")));",= " /// assert_eq!(y.unzip(), (None, None));", " /// ```", " #[inli= ne]", " #[unstable(feature =3D \"unzip_option\", issue =3D \"87800\", re= ason =3D \"recently added\")]", " pub const fn unzip(self) -> (Option= , Option) {", " match self {", " Some((a, b)) =3D> (So= me(a), Some(b)),", " None =3D> (None, None),", " }", " = }", "}", "", "impl Option<&T> {", " /// Maps an `Option<&T>` to an `= Option` by copying the contents of the", " /// option.", " ///", "= /// # Examples", " ///", " /// ```", " /// let x =3D 12;", " = /// let opt_x =3D Some(&x);", " /// assert_eq!(opt_x, Some(&12));", " = /// let copied =3D opt_x.copied();", " /// assert_eq!(copied, Some(12= ));", " /// ```", " #[must_use =3D \"`self` will be dropped if the re= sult is not used\"]", " #[stable(feature =3D \"copied\", since =3D \"1.3= 5.0\")]", " #[rustc_const_unstable(feature =3D \"const_option\", issue = =3D \"67441\")]", " pub const fn copied(self) -> Option", " where"= , " T: Copy,", " {", " // FIXME: this implementation, whic= h sidesteps using `Option::map` since it's not const", " // ready ye= t, should be reverted when possible to avoid code repetition", " mat= ch self {", " Some(&v) =3D> Some(v),", " None =3D> No= ne,", " }", " }", "", " /// Maps an `Option<&T>` to an `Option= ` by cloning the contents of the", " /// option.", " ///", " //= / # Examples", " ///", " /// ```", " /// let x =3D 12;", " /// = let opt_x =3D Some(&x);", " /// assert_eq!(opt_x, Some(&12));", " ///= let cloned =3D opt_x.cloned();", " /// assert_eq!(cloned, Some(12));", = " /// ```", " #[must_use =3D \"`self` will be dropped if the result i= s not used\"]", " #[stable(feature =3D \"rust1\", since =3D \"1.0.0\")]"= , " #[rustc_const_unstable(feature =3D \"const_option_cloned\", issue = =3D \"91582\")]", " pub const fn cloned(self) -> Option", " where"= , " T: ~const Clone,", " {", " match self {", " = Some(t) =3D> Some(t.clone()),", " None =3D> None,", " }"= , " }", "}", "", "impl Option<&mut T> {", " /// Maps an `Option<&m= ut T>` to an `Option` by copying the contents of the", " /// option."= , " ///", " /// # Examples", " ///", " /// ```", " /// let m= ut x =3D 12;", " /// let opt_x =3D Some(&mut x);", " /// assert_eq!(o= pt_x, Some(&mut 12));", " /// let copied =3D opt_x.copied();", " /// = assert_eq!(copied, Some(12));", " /// ```", " #[must_use =3D \"`self`= will be dropped if the result is not used\"]", " #[stable(feature =3D \= "copied\", since =3D \"1.35.0\")]", " #[rustc_const_unstable(feature =3D= \"const_option_ext\", issue =3D \"91930\")]", " pub const fn copied(sel= f) -> Option", " where", " T: Copy,", " {", " match = self {", " Some(&mut t) =3D> Some(t),", " None =3D> N= one,", " }", " }", "", " /// Maps an `Option<&mut T>` to an `O= ption` by cloning the contents of the", " /// option.", " ///", " = /// # Examples", " ///", " /// ```", " /// let mut x =3D 12;", = " /// let opt_x =3D Some(&mut x);", " /// assert_eq!(opt_x, Some(&mut= 12));", " /// let cloned =3D opt_x.cloned();", " /// assert_eq!(clon= ed, Some(12));", " /// ```", " #[must_use =3D \"`self` will be droppe= d if the result is not used\"]", " #[stable(since =3D \"1.26.0\", featur= e =3D \"option_ref_mut_cloned\")]", " #[rustc_const_unstable(feature =3D= \"const_option_cloned\", issue =3D \"91582\")]", " pub const fn cloned(= self) -> Option", " where", " T: ~const Clone,", " {", " = match self {", " Some(t) =3D> Some(t.clone()),", " = None =3D> None,", " }", " }", "}", "", "impl Option> {", " /// Transposes an `Option` of a [`Result`] into a [`Resu= lt`] of an `Option`.", " ///", " /// [`None`] will be mapped to [Ok]\\([None]).", " /// [Some]\\([Ok]\\(\\_)) and <= code>[Some]\\([Err]\\(\\_)) will be mapped to", " /// [Ok]\= \([Some]\\(\\_)) and [Err]\\(\\_).", " ///", " //= / # Examples", " ///", " /// ```", " /// #[derive(Debug, Eq, Parti= alEq)]", " /// struct SomeErr;", " ///", " /// let x: Result, SomeErr> =3D Ok(Some(5));", " /// let y: Option> =3D Some(Ok(5));", " /// assert_eq!(x, y.transpose());", " /// = ```", " #[inline]", " #[stable(feature =3D \"transpose_result\", sinc= e =3D \"1.33.0\")]", " #[rustc_const_unstable(feature =3D \"const_option= \", issue =3D \"67441\")]", " pub const fn transpose(self) -> Result, E> {", " match self {", " Some(Ok(x)) =3D> Ok(Som= e(x)),", " Some(Err(e)) =3D> Err(e),", " None =3D> Ok= (None),", " }", " }", "}", "", "// This is a separate function to= reduce the code size of .expect() itself.", "#[cfg_attr(not(feature =3D \"= panic_immediate_abort\"), inline(never))]", "#[cfg_attr(feature =3D \"panic= _immediate_abort\", inline)]", "#[cold]", "#[track_caller]", "#[rustc_const= _unstable(feature =3D \"const_option\", issue =3D \"67441\")]", "const fn e= xpect_failed(msg: &str) -> ! {", " panic_str(msg)", "}", "", "//////////= ///////////////////////////////////////////////////////////////////", "// T= rait implementations", "///////////////////////////////////////////////////= //////////////////////////", "", "#[stable(feature =3D \"rust1\", since =3D= \"1.0.0\")]", "#[rustc_const_unstable(feature =3D \"const_clone\", issue = =3D \"91805\")]", "impl const Clone for Option", "where", " T: ~co= nst Clone + ~const Destruct,", "{", " #[inline]", " fn clone(&self) -= > Self {", " match self {", " Some(x) =3D> Some(x.clone()= ),", " None =3D> None,", " }", " }", "", " #[inline= ]", " fn clone_from(&mut self, source: &Self) {", " match (self, = source) {", " (Some(to), Some(from)) =3D> to.clone_from(from),",= " (to, from) =3D> *to =3D from.clone(),", " }", " }",= "}", "", "#[stable(feature =3D \"rust1\", since =3D \"1.0.0\")]", "#[rustc= _const_unstable(feature =3D \"const_default_impls\", issue =3D \"87864\")]"= , "impl const Default for Option {", " /// Returns [`None`][Option= ::None].", " ///", " /// # Examples", " ///", " /// ```", " = /// let opt: Option =3D Option::default();", " /// assert!(opt.is_n= one());", " /// ```", " #[inline]", " fn default() -> Option {"= , " None", " }", "}", "", "#[stable(feature =3D \"rust1\", since = =3D \"1.0.0\")]", "impl IntoIterator for Option {", " type Item = =3D T;", " type IntoIter =3D IntoIter;", "", " /// Returns a consu= ming iterator over the possibly contained value.", " ///", " /// # Ex= amples", " ///", " /// ```", " /// let x =3D Some(\"string\");", "= /// let v: Vec<&str> =3D x.into_iter().collect();", " /// assert_eq!= (v, [\"string\"]);", " ///", " /// let x =3D None;", " /// let v: = Vec<&str> =3D x.into_iter().collect();", " /// assert!(v.is_empty());", = " /// ```", " #[inline]", " fn into_iter(self) -> IntoIter {", = " IntoIter { inner: Item { opt: self } }", " }", "}", "", "#[stab= le(since =3D \"1.4.0\", feature =3D \"option_iter\")]", "impl<'a, T> IntoIt= erator for &'a Option {", " type Item =3D &'a T;", " type IntoIter= =3D Iter<'a, T>;", "", " fn into_iter(self) -> Iter<'a, T> {", " = self.iter()", " }", "}", "", "#[stable(since =3D \"1.4.0\", feature =3D= \"option_iter\")]", "impl<'a, T> IntoIterator for &'a mut Option {", " = type Item =3D &'a mut T;", " type IntoIter =3D IterMut<'a, T>;", "", = " fn into_iter(self) -> IterMut<'a, T> {", " self.iter_mut()", " = }", "}", "", "#[stable(since =3D \"1.12.0\", feature =3D \"option_from\"= )]", "#[rustc_const_unstable(feature =3D \"const_convert\", issue =3D \"886= 74\")]", "impl const From for Option {", " /// Moves `val` into= a new [`Some`].", " ///", " /// # Examples", " ///", " /// ```= ", " /// let o: Option =3D Option::from(67);", " ///", " /// a= ssert_eq!(Some(67), o);", " /// ```", " fn from(val: T) -> Option = {", " Some(val)", " }", "}", "", "#[stable(feature =3D \"option_r= ef_from_ref_option\", since =3D \"1.30.0\")]", "#[rustc_const_unstable(feat= ure =3D \"const_convert\", issue =3D \"88674\")]", "impl<'a, T> const From<= &'a Option> for Option<&'a T> {", " /// Converts from `&Option` to= `Option<&T>`.", " ///", " /// # Examples", " ///", " /// Conve= rts an [Option]<[String]> into an [Option]<[usize]>, preserving", " /// the original. The [`map`] method takes the `self`= argument by value, consuming the original,", " /// so this technique us= es `from` to first take an [`Option`] to a reference", " /// to the valu= e inside the original.", " ///", " /// [`map`]: Option::map", " //= / [String]: ../../std/string/struct.String.html \"String\"", " ///", " = /// ```", " /// let s: Option =3D Some(String::from(\"Hello, R= ustaceans!\"));", " /// let o: Option =3D Option::from(&s).map(|s= s: &String| ss.len());", " ///", " /// println!(\"Can still print s: = {s:?}\");", " ///", " /// assert_eq!(o, Some(18));", " /// ```", "= fn from(o: &'a Option) -> Option<&'a T> {", " o.as_ref()", " = }", "}", "", "#[stable(feature =3D \"option_ref_from_ref_option\", since= =3D \"1.30.0\")]", "#[rustc_const_unstable(feature =3D \"const_convert\", = issue =3D \"88674\")]", "impl<'a, T> const From<&'a mut Option> for Opti= on<&'a mut T> {", " /// Converts from `&mut Option` to `Option<&mut T= >`", " ///", " /// # Examples", " ///", " /// ```", " /// le= t mut s =3D Some(String::from(\"Hello\"));", " /// let o: Option<&mut St= ring> =3D Option::from(&mut s);", " ///", " /// match o {", " /// = Some(t) =3D> *t =3D String::from(\"Hello, Rustaceans!\"),", " /// = None =3D> (),", " /// }", " ///", " /// assert_eq!(s, Some(Strin= g::from(\"Hello, Rustaceans!\")));", " /// ```", " fn from(o: &'a mut= Option) -> Option<&'a mut T> {", " o.as_mut()", " }", "}", ""= , "////////////////////////////////////////////////////////////////////////= /////", "// The Option Iterators", "///////////////////////////////////////= //////////////////////////////////////", "", "#[derive(Clone, Debug)]", "st= ruct Item {", " opt: Option,", "}", "", "impl Iterator for Item= {", " type Item =3D A;", "", " #[inline]", " fn next(&mut self= ) -> Option {", " self.opt.take()", " }", "", " #[inline]",= " fn size_hint(&self) -> (usize, Option) {", " match self= .opt {", " Some(_) =3D> (1, Some(1)),", " None =3D> (= 0, Some(0)),", " }", " }", "}", "", "impl DoubleEndedIterator = for Item {", " #[inline]", " fn next_back(&mut self) -> Option = {", " self.opt.take()", " }", "}", "", "impl ExactSizeIterator= for Item {}", "impl FusedIterator for Item {}", "unsafe impl T= rustedLen for Item {}", "", "/// An iterator over a reference to the [`S= ome`] variant of an [`Option`].", "///", "/// The iterator yields one value= if the [`Option`] is a [`Some`], otherwise none.", "///", "/// This `struc= t` is created by the [`Option::iter`] function.", "#[stable(feature =3D \"r= ust1\", since =3D \"1.0.0\")]", "#[derive(Debug)]", "pub struct Iter<'a, A:= 'a> {", " inner: Item<&'a A>,", "}", "", "#[stable(feature =3D \"rust1\= ", since =3D \"1.0.0\")]", "impl<'a, A> Iterator for Iter<'a, A> {", " t= ype Item =3D &'a A;", "", " #[inline]", " fn next(&mut self) -> Optio= n<&'a A> {", " self.inner.next()", " }", " #[inline]", " fn= size_hint(&self) -> (usize, Option) {", " self.inner.size_hi= nt()", " }", "}", "", "#[stable(feature =3D \"rust1\", since =3D \"1.0.0= \")]", "impl<'a, A> DoubleEndedIterator for Iter<'a, A> {", " #[inline]"= , " fn next_back(&mut self) -> Option<&'a A> {", " self.inner.nex= t_back()", " }", "}", "", "#[stable(feature =3D \"rust1\", since =3D \"1= .0.0\")]", "impl ExactSizeIterator for Iter<'_, A> {}", "", "#[stable(fe= ature =3D \"fused\", since =3D \"1.26.0\")]", "impl FusedIterator for It= er<'_, A> {}", "", "#[unstable(feature =3D \"trusted_len\", issue =3D \"375= 72\")]", "unsafe impl TrustedLen for Iter<'_, A> {}", "", "#[stable(feat= ure =3D \"rust1\", since =3D \"1.0.0\")]", "impl Clone for Iter<'_, A> {= ", " #[inline]", " fn clone(&self) -> Self {", " Iter { inner:= self.inner.clone() }", " }", "}", "", "/// An iterator over a mutable r= eference to the [`Some`] variant of an [`Option`].", "///", "/// The iterat= or yields one value if the [`Option`] is a [`Some`], otherwise none.", "///= ", "/// This `struct` is created by the [`Option::iter_mut`] function.", "#= [stable(feature =3D \"rust1\", since =3D \"1.0.0\")]", "#[derive(Debug)]", = "pub struct IterMut<'a, A: 'a> {", " inner: Item<&'a mut A>,", "}", "", = "#[stable(feature =3D \"rust1\", since =3D \"1.0.0\")]", "impl<'a, A> Itera= tor for IterMut<'a, A> {", " type Item =3D &'a mut A;", "", " #[inlin= e]", " fn next(&mut self) -> Option<&'a mut A> {", " self.inner.n= ext()", " }", " #[inline]", " fn size_hint(&self) -> (usize, Optio= n) {", " self.inner.size_hint()", " }", "}", "", "#[stable= (feature =3D \"rust1\", since =3D \"1.0.0\")]", "impl<'a, A> DoubleEndedIte= rator for IterMut<'a, A> {", " #[inline]", " fn next_back(&mut self) = -> Option<&'a mut A> {", " self.inner.next_back()", " }", "}", ""= , "#[stable(feature =3D \"rust1\", since =3D \"1.0.0\")]", "impl ExactSi= zeIterator for IterMut<'_, A> {}", "", "#[stable(feature =3D \"fused\", sin= ce =3D \"1.26.0\")]", "impl FusedIterator for IterMut<'_, A> {}", "#[uns= table(feature =3D \"trusted_len\", issue =3D \"37572\")]", "unsafe impl = TrustedLen for IterMut<'_, A> {}", "", "/// An iterator over the value in [= `Some`] variant of an [`Option`].", "///", "/// The iterator yields one val= ue if the [`Option`] is a [`Some`], otherwise none.", "///", "/// This `str= uct` is created by the [`Option::into_iter`] function.", "#[derive(Clone, D= ebug)]", "#[stable(feature =3D \"rust1\", since =3D \"1.0.0\")]", "pub stru= ct IntoIter {", " inner: Item,", "}", "", "#[stable(feature =3D \"= rust1\", since =3D \"1.0.0\")]", "impl Iterator for IntoIter {", " = type Item =3D A;", "", " #[inline]", " fn next(&mut self) -> Option<= A> {", " self.inner.next()", " }", " #[inline]", " fn size_= hint(&self) -> (usize, Option) {", " self.inner.size_hint()",= " }", "}", "", "#[stable(feature =3D \"rust1\", since =3D \"1.0.0\")]",= "impl DoubleEndedIterator for IntoIter {", " #[inline]", " fn = next_back(&mut self) -> Option {", " self.inner.next_back()", " = }", "}", "", "#[stable(feature =3D \"rust1\", since =3D \"1.0.0\")]", "im= pl ExactSizeIterator for IntoIter {}", "", "#[stable(feature =3D \"fu= sed\", since =3D \"1.26.0\")]", "impl FusedIterator for IntoIter {}",= "", "#[unstable(feature =3D \"trusted_len\", issue =3D \"37572\")]", "unsa= fe impl TrustedLen for IntoIter {}", "", "///////////////////////////= //////////////////////////////////////////////////", "// FromIterator", "//= ///////////////////////////////////////////////////////////////////////////= ", "", "#[stable(feature =3D \"rust1\", since =3D \"1.0.0\")]", "impl> FromIterator> for Option {", " /// Takes = each element in the [`Iterator`]: if it is [`None`][Option::None],", " /= // no further elements are taken, and the [`None`][Option::None] is", " = /// returned. Should no [`None`][Option::None] occur, a container of type",= " /// `V` containing the values of each [`Option`] is returned.", " = ///", " /// # Examples", " ///", " /// Here is an example which in= crements every integer in a vector.", " /// We use the checked variant o= f `add` that returns `None` when the", " /// calculation would result in= an overflow.", " ///", " /// ```", " /// let items =3D vec![0_u16= , 1, 2];", " ///", " /// let res: Option> =3D items", " /= // .iter()", " /// .map(|x| x.checked_add(1))", " /// .co= llect();", " ///", " /// assert_eq!(res, Some(vec![1, 2, 3]));", " = /// ```", " ///", " /// As you can see, this will return the expecte= d, valid items.", " ///", " /// Here is another example that tries to= subtract one from another list", " /// of integers, this time checking = for underflow:", " ///", " /// ```", " /// let items =3D vec![2_u1= 6, 1, 0];", " ///", " /// let res: Option> =3D items", " = /// .iter()", " /// .map(|x| x.checked_sub(1))", " /// .c= ollect();", " ///", " /// assert_eq!(res, None);", " /// ```", " = ///", " /// Since the last element is zero, it would underflow. Thus, = the resulting", " /// value is `None`.", " ///", " /// Here is a v= ariation on the previous example, showing that no", " /// further elemen= ts are taken from `iter` after the first `None`.", " ///", " /// ```"= , " /// let items =3D vec![3_u16, 2, 1, 10];", " ///", " /// let m= ut shared =3D 0;", " ///", " /// let res: Option> =3D items"= , " /// .iter()", " /// .map(|x| { shared +=3D x; x.checked_s= ub(2) })", " /// .collect();", " ///", " /// assert_eq!(res, N= one);", " /// assert_eq!(shared, 6);", " /// ```", " ///", " //= / Since the third element caused an underflow, no further elements were tak= en,", " /// so the final value of `shared` is 6 (=3D `3 + 2 + 1`), not 1= 6.", " #[inline]", " fn from_iter>= >(iter: I) -> Option {", " // FIXME(#11084): This could be replac= ed with Iterator::scan when this", " // performance bug is closed.",= "", " iter::try_process(iter.into_iter(), |i| i.collect())", " }= ", "}", "", "#[unstable(feature =3D \"try_trait_v2\", issue =3D \"84277\")]= ", "#[rustc_const_unstable(feature =3D \"const_convert\", issue =3D \"88674= \")]", "impl const ops::Try for Option {", " type Output =3D T;", = " type Residual =3D Option;", "", " #[inline]", = " fn from_output(output: Self::Output) -> Self {", " Some(output)= ", " }", "", " #[inline]", " fn branch(self) -> ControlFlow {", " match self {", " Some(v) = =3D> ControlFlow::Continue(v),", " None =3D> ControlFlow::Break(= None),", " }", " }", "}", "", "#[unstable(feature =3D \"try_trait= _v2\", issue =3D \"84277\")]", "#[rustc_const_unstable(feature =3D \"const_= convert\", issue =3D \"88674\")]", "impl const ops::FromResidual for Opt= ion {", " #[inline]", " fn from_residual(residual: Option) -> Self {", " match residual {", " None =3D= > None,", " }", " }", "}", "", "#[unstable(feature =3D \"try_trai= t_v2_yeet\", issue =3D \"96374\")]", "impl ops::FromResidual> for Option {", " #[inline]", " fn from_residual(ops::Yeet(()):= ops::Yeet<()>) -> Self {", " None", " }", "}", "", "#[unstable(f= eature =3D \"try_trait_v2_residual\", issue =3D \"91285\")]", "impl ops:= :Residual for Option {", " type TryType =3D Opti= on;", "}", "", "impl Option> {", " /// Converts from `Op= tion>` to `Option`.", " ///", " /// # Examples", " //= /", " /// Basic usage:", " ///", " /// ```", " /// let x: Optio= n> =3D Some(Some(6));", " /// assert_eq!(Some(6), x.flatten(= ));", " ///", " /// let x: Option> =3D Some(None);", " = /// assert_eq!(None, x.flatten());", " ///", " /// let x: Option> =3D None;", " /// assert_eq!(None, x.flatten());", " /// ``= `", " ///", " /// Flattening only removes one level of nesting at a t= ime:", " ///", " /// ```", " /// let x: Option>= > =3D Some(Some(Some(6)));", " /// assert_eq!(Some(Some(6)), x.flatten()= );", " /// assert_eq!(Some(6), x.flatten().flatten());", " /// ```", = " #[inline]", " #[stable(feature =3D \"option_flattening\", since =3D= \"1.40.0\")]", " #[rustc_const_unstable(feature =3D \"const_option\", i= ssue =3D \"67441\")]", " pub const fn flatten(self) -> Option {", " = match self {", " Some(inner) =3D> inner,", " No= ne =3D> None,", " }", " }", "}", ""]} 17:00:16 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"eval","params":["s:GetVar('LanguageClient_setOmnifunc', v:true)"]= ,"id":30} 17:00:16 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 30, "jsonr= pc": "2.0", "result": true} 17:00:16 DEBUG unnamed src/language_client.rs:108 state.text_documents./hom= e/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/r= ust/library/core/src/option.rs: null =3D=3D> {"languageId":"rust","text":"/= /! Optional values.\n//!\n//! Type [`Option`] represents an optional value:= every [`Option`]\n//! is either [`Some`] and contains a value, or [`None`]= , and\n//! does not. [`Option`] types are very common in Rust code, as\n//!= they have a number of uses:\n//!\n//! * Initial values\n//! * Return value= s for functions that are not defined\n//! over their entire input range (= partial functions)\n//! * Return value for otherwise reporting simple error= s, where [`None`] is\n//! returned on error\n//! * Optional struct fields= \n//! * Struct fields that can be loaned or \"taken\"\n//! * Optional funct= ion arguments\n//! * Nullable pointers\n//! * Swapping things out of diffic= ult situations\n//!\n//! [`Option`]s are commonly paired with pattern match= ing to query the presence\n//! of a value and take action, always accountin= g for the [`None`] case.\n//!\n//! ```\n//! fn divide(numerator: f64, denom= inator: f64) -> Option {\n//! if denominator =3D=3D 0.0 {\n//! = None\n//! } else {\n//! Some(numerator / denominator)\n//!= }\n//! }\n//!\n//! // The return value of the function is an option\n/= /! let result =3D divide(2.0, 3.0);\n//!\n//! // Pattern match to retrieve = the value\n//! match result {\n//! // The division was valid\n//! S= ome(x) =3D> println!(\"Result: {x}\"),\n//! // The division was invalid= \n//! None =3D> println!(\"Cannot divide by 0\"),\n//! }\n//! ```\n/= /!\n//\n// FIXME: Show how `Option` is used in practice, with lots of metho= ds\n//\n//! # Options and pointers (\"nullable\" pointers)\n//!\n//! Rust's= pointer types must always point to a valid location; there are\n//! no \"n= ull\" references. Instead, Rust has *optional* pointers, like\n//! the opti= onal owned box, [Option]<[Box\\]>.\n//!\n//! [Box\\]: ..= /../std/boxed/struct.Box.html\n//!\n//! The following example uses [`Option= `] to create an optional box of\n//! [`i32`]. Notice that in order to use t= he inner [`i32`] value, the\n//! `check_optional` function first needs to u= se pattern matching to\n//! determine whether the box has a value (i.e., it= is [`Some(...)`][`Some`]) or\n//! not ([`None`]).\n//!\n//! ```\n//! let o= ptional =3D None;\n//! check_optional(optional);\n//!\n//! let optional =3D= Some(Box::new(9000));\n//! check_optional(optional);\n//!\n//! fn check_op= tional(optional: Option>) {\n//! match optional {\n//! = Some(p) =3D> println!(\"has value {p}\"),\n//! None =3D> println!(= \"has no value\"),\n//! }\n//! }\n//! ```\n//!\n//! # Representation\n/= /!\n//! Rust guarantees to optimize the following types `T` such that\n//! = [`Option`] has the same size as `T`:\n//!\n//! * [`Box`]\n//! * `&U`\= n//! * `&mut U`\n//! * `fn`, `extern \"C\" fn`[^extern_fn]\n//! * [`num::No= nZero*`]\n//! * [`ptr::NonNull`]\n//! * `#[repr(transparent)]` struct ar= ound one of the types in this list.\n//!\n//! [^extern_fn]: this remains tr= ue for any other ABI: `extern \"abi\" fn` (_e.g._, `extern \"system\" fn`)\= n//!\n//! [`Box`]: ../../std/boxed/struct.Box.html\n//! [`num::NonZero*`= ]: crate::num\n//! [`ptr::NonNull`]: crate::ptr::NonNull\n//!\n//! This = is called the \"null pointer optimization\" or NPO.\n//!\n//! It is further= guaranteed that, for the cases above, one can\n//! [`mem::transmute`] from= all valid values of `T` to `Option` and\n//! from `Some::(_)` to `T`= (but transmuting `None::` to `T`\n//! is undefined behaviour).\n//!\n//= ! # Method overview\n//!\n//! In addition to working with pattern matching,= [`Option`] provides a wide\n//! variety of different methods.\n//!\n//! ##= Querying the variant\n//!\n//! The [`is_some`] and [`is_none`] methods ret= urn [`true`] if the [`Option`]\n//! is [`Some`] or [`None`], respectively.\= n//!\n//! [`is_none`]: Option::is_none\n//! [`is_some`]: Option::is_some\n/= /!\n//! ## Adapters for working with references\n//!\n//! * [`as_ref`] conv= erts from [&][][Option]\\ to [Option]<[&]T>\n/= /! * [`as_mut`] converts from [&mut] [Option]\\ to [O= ption]<[&mut] T>\n//! * [`as_deref`] converts from [&][][Optio= n]\\ to\n//! [Option]<[&]T::[Target]>\n//! * [`as_= deref_mut`] converts from [&mut] [Option]\\ to\n//! [Option]<[&mut] T::[Target]>\n//! * [`as_pin_ref`] converts from [Pin]<[&][][Option]\\> to\n//! [Option]<[Pin]<[&]T>><= /code>\n//! * [`as_pin_mut`] converts from [Pin]<[&mut] [Option]\\= > to\n//! [Option]<[Pin]<[&mut] T>>\n//!\n//! [&]: re= ference \"shared reference\"\n//! [&mut]: reference \"mutable reference\"\n= //! [Target]: Deref::Target \"ops::Deref::Target\"\n//! [`as_deref`]: Optio= n::as_deref\n//! [`as_deref_mut`]: Option::as_deref_mut\n//! [`as_mut`]: Op= tion::as_mut\n//! [`as_pin_mut`]: Option::as_pin_mut\n//! [`as_pin_ref`]: O= ption::as_pin_ref\n//! [`as_ref`]: Option::as_ref\n//!\n//! ## Extracting t= he contained value\n//!\n//! These methods extract the contained value in a= n [`Option`] when it\n//! is the [`Some`] variant. If the [`Option`] is = [`None`]:\n//!\n//! * [`expect`] panics with a provided custom message\n//!= * [`unwrap`] panics with a generic message\n//! * [`unwrap_or`] returns th= e provided default value\n//! * [`unwrap_or_default`] returns the default v= alue of the type `T`\n//! (which must implement the [`Default`] trait)\n/= /! * [`unwrap_or_else`] returns the result of evaluating the provided\n//! = function\n//!\n//! [`expect`]: Option::expect\n//! [`unwrap`]: Option::un= wrap\n//! [`unwrap_or`]: Option::unwrap_or\n//! [`unwrap_or_default`]: Opti= on::unwrap_or_default\n//! [`unwrap_or_else`]: Option::unwrap_or_else\n//!\= n//! ## Transforming contained values\n//!\n//! These methods transform [`O= ption`] to [`Result`]:\n//!\n//! * [`ok_or`] transforms [`Some(v)`] to [`Ok= (v)`], and [`None`] to\n//! [`Err(err)`] using the provided default `err`= value\n//! * [`ok_or_else`] transforms [`Some(v)`] to [`Ok(v)`], and [`Non= e`] to\n//! a value of [`Err`] using the provided function\n//! * [`trans= pose`] transposes an [`Option`] of a [`Result`] into a\n//! [`Result`] of= an [`Option`]\n//!\n//! [`Err(err)`]: Err\n//! [`Ok(v)`]: Ok\n//! [`Some(v= )`]: Some\n//! [`ok_or`]: Option::ok_or\n//! [`ok_or_else`]: Option::ok_or_= else\n//! [`transpose`]: Option::transpose\n//!\n//! These methods transfor= m the [`Some`] variant:\n//!\n//! * [`filter`] calls the provided predicate= function on the contained\n//! value `t` if the [`Option`] is [`Some(t)`= ], and returns [`Some(t)`]\n//! if the function returns `true`; otherwise= , returns [`None`]\n//! * [`flatten`] removes one level of nesting from an\= n//! [`Option>`]\n//! * [`map`] transforms [`Option`] to [`O= ption`] by applying the\n//! provided function to the contained value = of [`Some`] and leaving\n//! [`None`] values unchanged\n//!\n//! [`Some(t= )`]: Some\n//! [`filter`]: Option::filter\n//! [`flatten`]: Option::flatten= \n//! [`map`]: Option::map\n//!\n//! These methods transform [`Option`] = to a value of a possibly\n//! different type `U`:\n//!\n//! * [`map_or`] ap= plies the provided function to the contained value of\n//! [`Some`], or r= eturns the provided default value if the [`Option`] is\n//! [`None`]\n//!= * [`map_or_else`] applies the provided function to the contained value\n//= ! of [`Some`], or returns the result of evaluating the provided\n//! fa= llback function if the [`Option`] is [`None`]\n//!\n//! [`map_or`]: Option:= :map_or\n//! [`map_or_else`]: Option::map_or_else\n//!\n//! These methods c= ombine the [`Some`] variants of two [`Option`] values:\n//!\n//! * [`zip`] = returns [`Some((s, o))`] if `self` is [`Some(s)`] and the\n//! provided [= `Option`] value is [`Some(o)`]; otherwise, returns [`None`]\n//! * [`zip_wi= th`] calls the provided function `f` and returns\n//! [`Some(f(s, o))`] i= f `self` is [`Some(s)`] and the provided\n//! [`Option`] value is [`Some(= o)`]; otherwise, returns [`None`]\n//!\n//! [`Some(f(s, o))`]: Some\n//! [`= Some(o)`]: Some\n//! [`Some(s)`]: Some\n//! [`Some((s, o))`]: Some\n//! [`z= ip`]: Option::zip\n//! [`zip_with`]: Option::zip_with\n//!\n//! ## Boolean = operators\n//!\n//! These methods treat the [`Option`] as a boolean value, = where [`Some`]\n//! acts like [`true`] and [`None`] acts like [`false`]. Th= ere are two\n//! categories of these methods: ones that take an [`Option`] = as input, and\n//! ones that take a function as input (to be lazily evaluat= ed).\n//!\n//! The [`and`], [`or`], and [`xor`] methods take another [`Opti= on`] as\n//! input, and produce an [`Option`] as output. Only the [`and`] m= ethod can\n//! produce an [`Option`] value having a different inner type= `U` than\n//! [`Option`].\n//!\n//! | method | self | input |= output |\n//! |---------|-----------|-----------|-----------|\n//! | [`= and`] | `None` | (ignored) | `None` |\n//! | [`and`] | `Some(x)` | `N= one` | `None` |\n//! | [`and`] | `Some(x)` | `Some(y)` | `Some(y)` |\= n//! | [`or`] | `None` | `None` | `None` |\n//! | [`or`] | `None= ` | `Some(y)` | `Some(y)` |\n//! | [`or`] | `Some(x)` | (ignored) | `So= me(x)` |\n//! | [`xor`] | `None` | `None` | `None` |\n//! | [`xor`= ] | `None` | `Some(y)` | `Some(y)` |\n//! | [`xor`] | `Some(x)` | `None`= | `Some(x)` |\n//! | [`xor`] | `Some(x)` | `Some(y)` | `None` |\n//!= \n//! [`and`]: Option::and\n//! [`or`]: Option::or\n//! [`xor`]: Option::xo= r\n//!\n//! The [`and_then`] and [`or_else`] methods take a function as inp= ut, and\n//! only evaluate the function when they need to produce a new val= ue. Only\n//! the [`and_then`] method can produce an [`Option`] value ha= ving a\n//! different inner type `U` than [`Option`].\n//!\n//! | method= | self | function input | function result | output |\n//! |-= -------------|-----------|----------------|-----------------|-----------|\n= //! | [`and_then`] | `None` | (not provided) | (not evaluated) | `None` = |\n//! | [`and_then`] | `Some(x)` | `x` | `None` | `= None` |\n//! | [`and_then`] | `Some(x)` | `x` | `Some(y)` = | `Some(y)` |\n//! | [`or_else`] | `None` | (not provided) | `None` = | `None` |\n//! | [`or_else`] | `None` | (not provided) | `= Some(y)` | `Some(y)` |\n//! | [`or_else`] | `Some(x)` | (not provide= d) | (not evaluated) | `Some(x)` |\n//!\n//! [`and_then`]: Option::and_then= \n//! [`or_else`]: Option::or_else\n//!\n//! This is an example of using me= thods like [`and_then`] and [`or`] in a\n//! pipeline of method calls. Earl= y stages of the pipeline pass failure\n//! values ([`None`]) through unchan= ged, and continue processing on\n//! success values ([`Some`]). Toward the = end, [`or`] substitutes an error\n//! message if it receives [`None`].\n//!= \n//! ```\n//! # use std::collections::BTreeMap;\n//! let mut bt =3D BTreeM= ap::new();\n//! bt.insert(20u8, \"foo\");\n//! bt.insert(42u8, \"bar\");\n/= /! let res =3D [0u8, 1, 11, 200, 22]\n//! .into_iter()\n//! .map(|x= | {\n//! // `checked_sub()` returns `None` on error\n//! x.= checked_sub(1)\n//! // same with `checked_mul()`\n//! = .and_then(|x| x.checked_mul(2))\n//! // `BTreeMap::get` retu= rns `None` on error\n//! .and_then(|x| bt.get(&x))\n//! = // Substitute an error message if we have `None` so far\n//! = .or(Some(&\"error!\"))\n//! .copied()\n//! // Wo= n't panic because we unconditionally used `Some` above\n//! .un= wrap()\n//! })\n//! .collect::>();\n//! assert_eq!(res, [\"e= rror!\", \"error!\", \"foo\", \"error!\", \"bar\"]);\n//! ```\n//!\n//! ## = Comparison operators\n//!\n//! If `T` implements [`PartialOrd`] then [`Opti= on`] will derive its\n//! [`PartialOrd`] implementation. With this orde= r, [`None`] compares as\n//! less than any [`Some`], and two [`Some`] compa= re the same way as their\n//! contained values would in `T`. If `T` also i= mplements\n//! [`Ord`], then so does [`Option`].\n//!\n//! ```\n//! asse= rt!(None < Some(0));\n//! assert!(Some(0) < Some(1));\n//! ```\n//!\n//! ##= Iterating over `Option`\n//!\n//! An [`Option`] can be iterated over. This= can be helpful if you need an\n//! iterator that is conditionally empty. T= he iterator will either produce\n//! a single value (when the [`Option`] is= [`Some`]), or produce no values\n//! (when the [`Option`] is [`None`]). Fo= r example, [`into_iter`] acts like\n//! [`once(v)`] if the [`Option`] is [`= Some(v)`], and like [`empty()`] if\n//! the [`Option`] is [`None`].\n//!\n/= /! [`Some(v)`]: Some\n//! [`empty()`]: crate::iter::empty\n//! [`once(v)`]:= crate::iter::once\n//!\n//! Iterators over [`Option`] come in three typ= es:\n//!\n//! * [`into_iter`] consumes the [`Option`] and produces the cont= ained\n//! value\n//! * [`iter`] produces an immutable reference of type = `&T` to the\n//! contained value\n//! * [`iter_mut`] produces a mutable r= eference of type `&mut T` to the\n//! contained value\n//!\n//! [`into_it= er`]: Option::into_iter\n//! [`iter`]: Option::iter\n//! [`iter_mut`]: Opti= on::iter_mut\n//!\n//! An iterator over [`Option`] can be useful when chain= ing iterators, for\n//! example, to conditionally insert items. (It's not a= lways necessary to\n//! explicitly call an iterator constructor: many [`Ite= rator`] methods that\n//! accept other iterators will also accept iterable = types that implement\n//! [`IntoIterator`], which includes [`Option`].)\n//= !\n//! ```\n//! let yep =3D Some(42);\n//! let nope =3D None;\n//! // chain= () already calls into_iter(), so we don't have to do so\n//! let nums: Vec<= i32> =3D (0..4).chain(yep).chain(4..8).collect();\n//! assert_eq!(nums, [0,= 1, 2, 3, 42, 4, 5, 6, 7]);\n//! let nums: Vec =3D (0..4).chain(nope).= chain(4..8).collect();\n//! assert_eq!(nums, [0, 1, 2, 3, 4, 5, 6, 7]);\n//= ! ```\n//!\n//! One reason to chain iterators in this way is that a functio= n returning\n//! `impl Iterator` must have all possible return values be of= the same\n//! concrete type. Chaining an iterated [`Option`] can help with= that.\n//!\n//! ```\n//! fn make_iter(do_insert: bool) -> impl Iterator {\n//! // Explicit returns to illustrate return types match= ing\n//! match do_insert {\n//! true =3D> return (0..4).chain(S= ome(42)).chain(4..8),\n//! false =3D> return (0..4).chain(None).cha= in(4..8),\n//! }\n//! }\n//! println!(\"{:?}\", make_iter(true).collect= ::>());\n//! println!(\"{:?}\", make_iter(false).collect::>()= );\n//! ```\n//!\n//! If we try to do the same thing, but using [`once()`] = and [`empty()`],\n//! we can't return `impl Iterator` anymore because the c= oncrete types of\n//! the return values differ.\n//!\n//! [`empty()`]: crat= e::iter::empty\n//! [`once()`]: crate::iter::once\n//!\n//! ```compile_fail= ,E0308\n//! # use std::iter::{empty, once};\n//! // This won't compile beca= use all possible returns from the function\n//! // must have the same concr= ete type.\n//! fn make_iter(do_insert: bool) -> impl Iterator= {\n//! // Explicit returns to illustrate return types not matching\n//= ! match do_insert {\n//! true =3D> return (0..4).chain(once(42)= ).chain(4..8),\n//! false =3D> return (0..4).chain(empty()).chain(4= ..8),\n//! }\n//! }\n//! ```\n//!\n//! ## Collecting into `Option`\n//!= \n//! [`Option`] implements the [`FromIterator`][impl-FromIterator] trait,\= n//! which allows an iterator over [`Option`] values to be collected into a= n\n//! [`Option`] of a collection of each contained value of the original\n= //! [`Option`] values, or [`None`] if any of the elements was [`None`].\n//= !\n//! [impl-FromIterator]: Option#impl-FromIterator%3COption%3CA%3E%3E\n//= !\n//! ```\n//! let v =3D [Some(2), Some(4), None, Some(8)];\n//! let res: = Option> =3D v.into_iter().collect();\n//! assert_eq!(res, None);\n//= ! let v =3D [Some(2), Some(4), Some(8)];\n//! let res: Option> =3D v= .into_iter().collect();\n//! assert_eq!(res, Some(vec![2, 4, 8]));\n//! ```= \n//!\n//! [`Option`] also implements the [`Product`][impl-Product] and\n//= ! [`Sum`][impl-Sum] traits, allowing an iterator over [`Option`] values\n//= ! to provide the [`product`][Iterator::product] and\n//! [`sum`][Iterator::= sum] methods.\n//!\n//! [impl-Product]: Option#impl-Product%3COption%3CU%3E= %3E\n//! [impl-Sum]: Option#impl-Sum%3COption%3CU%3E%3E\n//!\n//! ```\n//! = let v =3D [None, Some(1), Some(2), Some(3)];\n//! let res: Option =3D = v.into_iter().sum();\n//! assert_eq!(res, None);\n//! let v =3D [Some(1), S= ome(2), Some(21)];\n//! let res: Option =3D v.into_iter().product();\n= //! assert_eq!(res, Some(42));\n//! ```\n//!\n//! ## Modifying an [`Option`= ] in-place\n//!\n//! These methods return a mutable reference to the contai= ned value of an\n//! [`Option`]:\n//!\n//! * [`insert`] inserts a value,= dropping any old contents\n//! * [`get_or_insert`] gets the current value,= inserting a provided\n//! default value if it is [`None`]\n//! * [`get_o= r_insert_default`] gets the current value, inserting the\n//! default val= ue of type `T` (which must implement [`Default`]) if it is\n//! [`None`]\= n//! * [`get_or_insert_with`] gets the current value, inserting a default\n= //! computed by the provided function if it is [`None`]\n//!\n//! [`get_o= r_insert`]: Option::get_or_insert\n//! [`get_or_insert_default`]: Option::g= et_or_insert_default\n//! [`get_or_insert_with`]: Option::get_or_insert_wit= h\n//! [`insert`]: Option::insert\n//!\n//! These methods transfer ownershi= p of the contained value of an\n//! [`Option`]:\n//!\n//! * [`take`] takes = ownership of the contained value of an [`Option`], if\n//! any, replacing= the [`Option`] with [`None`]\n//! * [`replace`] takes ownership of the con= tained value of an [`Option`],\n//! if any, replacing the [`Option`] with= a [`Some`] containing the\n//! provided value\n//!\n//! [`replace`]: Opt= ion::replace\n//! [`take`]: Option::take\n//!\n//! # Examples\n//!\n//! Bas= ic pattern matching on [`Option`]:\n//!\n//! ```\n//! let msg =3D Some(\"ho= wdy\");\n//!\n//! // Take a reference to the contained string\n//! if let S= ome(m) =3D &msg {\n//! println!(\"{}\", *m);\n//! }\n//!\n//! // Remove= the contained string, destroying the Option\n//! let unwrapped_msg =3D msg= .unwrap_or(\"default message\");\n//! ```\n//!\n//! Initialize a result to = [`None`] before a loop:\n//!\n//! ```\n//! enum Kingdom { Plant(u32, &'stat= ic str), Animal(u32, &'static str) }\n//!\n//! // A list of data to search = through.\n//! let all_the_big_things =3D [\n//! Kingdom::Plant(250, \"r= edwood\"),\n//! Kingdom::Plant(230, \"noble fir\"),\n//! Kingdom::P= lant(229, \"sugar pine\"),\n//! Kingdom::Animal(25, \"blue whale\"),\n/= /! Kingdom::Animal(19, \"fin whale\"),\n//! Kingdom::Animal(15, \"n= orth pacific right whale\"),\n//! ];\n//!\n//! // We're going to search for= the name of the biggest animal,\n//! // but to start with we've just got `= None`.\n//! let mut name_of_biggest_animal =3D None;\n//! let mut size_of_b= iggest_animal =3D 0;\n//! for big_thing in &all_the_big_things {\n//! m= atch *big_thing {\n//! Kingdom::Animal(size, name) if size > size_o= f_biggest_animal =3D> {\n//! // Now we've found the name of som= e big animal\n//! size_of_biggest_animal =3D size;\n//! = name_of_biggest_animal =3D Some(name);\n//! }\n//! Kin= gdom::Animal(..) | Kingdom::Plant(..) =3D> ()\n//! }\n//! }\n//!\n//! m= atch name_of_biggest_animal {\n//! Some(name) =3D> println!(\"the bigge= st animal is {name}\"),\n//! None =3D> println!(\"there are no animals = :(\"),\n//! }\n//! ```\n\n#![stable(feature =3D \"rust1\", since =3D \"1.0.= 0\")]\n\nuse crate::iter::{self, FromIterator, FusedIterator, TrustedLen};\= nuse crate::marker::Destruct;\nuse crate::panicking::{panic, panic_str};\nu= se crate::pin::Pin;\nuse crate::{\n convert, hint, mem,\n ops::{self,= ControlFlow, Deref, DerefMut},\n};\n\n/// The `Option` type. See [the modu= le level documentation](self) for more.\n#[derive(Copy, PartialEq, PartialO= rd, Eq, Ord, Debug, Hash)]\n#[rustc_diagnostic_item =3D \"Option\"]\n#[stab= le(feature =3D \"rust1\", since =3D \"1.0.0\")]\npub enum Option {\n = /// No value.\n #[lang =3D \"None\"]\n #[stable(feature =3D \"rust1\"= , since =3D \"1.0.0\")]\n None,\n /// Some value of type `T`.\n #[= lang =3D \"Some\"]\n #[stable(feature =3D \"rust1\", since =3D \"1.0.0\"= )]\n Some(#[stable(feature =3D \"rust1\", since =3D \"1.0.0\")] T),\n}\n= \n/////////////////////////////////////////////////////////////////////////= ////\n// Type implementation\n/////////////////////////////////////////////= ////////////////////////////////\n\nimpl Option {\n //////////////= ///////////////////////////////////////////////////////////\n // Queryin= g the contained values\n ///////////////////////////////////////////////= //////////////////////////\n\n /// Returns `true` if the option is a [`S= ome`] value.\n ///\n /// # Examples\n ///\n /// ```\n /// le= t x: Option =3D Some(2);\n /// assert_eq!(x.is_some(), true);\n = ///\n /// let x: Option =3D None;\n /// assert_eq!(x.is_some(), = false);\n /// ```\n #[must_use =3D \"if you intended to assert that t= his has a value, consider `.unwrap()` instead\"]\n #[inline]\n #[stab= le(feature =3D \"rust1\", since =3D \"1.0.0\")]\n #[rustc_const_stable(f= eature =3D \"const_option_basics\", since =3D \"1.48.0\")]\n pub const f= n is_some(&self) -> bool {\n matches!(*self, Some(_))\n }\n\n = /// Returns `true` if the option is a [`Some`] and the value inside of it m= atches a predicate.\n ///\n /// # Examples\n ///\n /// ```\n = /// #![feature(is_some_with)]\n ///\n /// let x: Option =3D Som= e(2);\n /// assert_eq!(x.is_some_and(|&x| x > 1), true);\n ///\n /= // let x: Option =3D Some(0);\n /// assert_eq!(x.is_some_and(|&x| x= > 1), false);\n ///\n /// let x: Option =3D None;\n /// asse= rt_eq!(x.is_some_and(|&x| x > 1), false);\n /// ```\n #[must_use]\n = #[inline]\n #[unstable(feature =3D \"is_some_with\", issue =3D \"93050= \")]\n pub fn is_some_and(&self, f: impl FnOnce(&T) -> bool) -> bool {\n= matches!(self, Some(x) if f(x))\n }\n\n /// Returns `true` if= the option is a [`None`] value.\n ///\n /// # Examples\n ///\n = /// ```\n /// let x: Option =3D Some(2);\n /// assert_eq!(x.is_= none(), false);\n ///\n /// let x: Option =3D None;\n /// ass= ert_eq!(x.is_none(), true);\n /// ```\n #[must_use =3D \"if you inten= ded to assert that this doesn't have a value, consider \\\n = `.and_then(|_| panic!(\\\"`Option` had a value when expected `None`\\\"))= ` instead\"]\n #[inline]\n #[stable(feature =3D \"rust1\", since =3D = \"1.0.0\")]\n #[rustc_const_stable(feature =3D \"const_option_basics\", = since =3D \"1.48.0\")]\n pub const fn is_none(&self) -> bool {\n = !self.is_some()\n }\n\n /////////////////////////////////////////////= ////////////////////////////\n // Adapter for working with references\n = ////////////////////////////////////////////////////////////////////////= /\n\n /// Converts from `&Option` to `Option<&T>`.\n ///\n /// = # Examples\n ///\n /// Converts an Option<[String]> into= an Option<[usize]>, preserving\n /// the original. The [`m= ap`] method takes the `self` argument by value, consuming the original,\n = /// so this technique uses `as_ref` to first take an `Option` to a refere= nce\n /// to the value inside the original.\n ///\n /// [`map`]: O= ption::map\n /// [String]: ../../std/string/struct.String.html \"String\= "\n ///\n /// ```\n /// let text: Option =3D Some(\"Hello,= world!\".to_string());\n /// // First, cast `Option` to `Option= <&String>` with `as_ref`,\n /// // then consume *that* with `map`, leavi= ng `text` on the stack.\n /// let text_length: Option =3D text.as= _ref().map(|s| s.len());\n /// println!(\"still can print text: {text:?}= \");\n /// ```\n #[inline]\n #[rustc_const_stable(feature =3D \"co= nst_option_basics\", since =3D \"1.48.0\")]\n #[stable(feature =3D \"rus= t1\", since =3D \"1.0.0\")]\n pub const fn as_ref(&self) -> Option<&T> {= \n match *self {\n Some(ref x) =3D> Some(x),\n = None =3D> None,\n }\n }\n\n /// Converts from `&mut Option= ` to `Option<&mut T>`.\n ///\n /// # Examples\n ///\n /// ```\n= /// let mut x =3D Some(2);\n /// match x.as_mut() {\n /// Som= e(v) =3D> *v =3D 42,\n /// None =3D> {},\n /// }\n /// assert_= eq!(x, Some(42));\n /// ```\n #[inline]\n #[stable(feature =3D \"r= ust1\", since =3D \"1.0.0\")]\n #[rustc_const_unstable(feature =3D \"con= st_option\", issue =3D \"67441\")]\n pub const fn as_mut(&mut self) -> O= ption<&mut T> {\n match *self {\n Some(ref mut x) =3D> So= me(x),\n None =3D> None,\n }\n }\n\n /// Converts f= rom [Pin]<[&]Option\\> to Option<[Pin]<[&]T>>.= \n ///\n /// [&]: reference \"shared reference\"\n #[inline]\n = #[must_use]\n #[stable(feature =3D \"pin\", since =3D \"1.33.0\")]\n = #[rustc_const_unstable(feature =3D \"const_option_ext\", issue =3D \"91930\= ")]\n pub const fn as_pin_ref(self: Pin<&Self>) -> Option> {\n = match Pin::get_ref(self).as_ref() {\n // SAFETY: `x` is gu= aranteed to be pinned because it comes from `self`\n // which is= pinned.\n Some(x) =3D> unsafe { Some(Pin::new_unchecked(x)) },\= n None =3D> None,\n }\n }\n\n /// Converts from [Pin]<[&mut] Option\\> to Option<[Pin]<[&mut] T>>= .\n ///\n /// [&mut]: reference \"mutable reference\"\n #[inline]\= n #[must_use]\n #[stable(feature =3D \"pin\", since =3D \"1.33.0\")]\= n #[rustc_const_unstable(feature =3D \"const_option_ext\", issue =3D \"9= 1930\")]\n pub const fn as_pin_mut(self: Pin<&mut Self>) -> Option> {\n // SAFETY: `get_unchecked_mut` is never used to move the= `Option` inside `self`.\n // `x` is guaranteed to be pinned because= it comes from `self` which is pinned.\n unsafe {\n match= Pin::get_unchecked_mut(self).as_mut() {\n Some(x) =3D> Some= (Pin::new_unchecked(x)),\n None =3D> None,\n }\n = }\n }\n\n ////////////////////////////////////////////////////= /////////////////////\n // Getting to contained values\n ////////////= /////////////////////////////////////////////////////////////\n\n /// Re= turns the contained [`Some`] value, consuming the `self` value.\n ///\n = /// # Panics\n ///\n /// Panics if the value is a [`None`] with a = custom panic message provided by\n /// `msg`.\n ///\n /// # Exampl= es\n ///\n /// ```\n /// let x =3D Some(\"value\");\n /// asser= t_eq!(x.expect(\"fruits are healthy\"), \"value\");\n /// ```\n ///\n= /// ```should_panic\n /// let x: Option<&str> =3D None;\n /// x.e= xpect(\"fruits are healthy\"); // panics with `fruits are healthy`\n ///= ```\n ///\n /// # Recommended Message Style\n ///\n /// We rec= ommend that `expect` messages are used to describe the reason you\n /// = _expect_ the `Option` should be `Some`.\n ///\n /// ```should_panic\n= /// # let slice: &[u8] =3D &[];\n /// let item =3D slice.get(0)\n = /// .expect(\"slice should not be empty\");\n /// ```\n ///\n = /// **Hint**: If you're having trouble remembering how to phrase expect\n = /// error messages remember to focus on the word \"should\" as in \"env\= n /// variable should be set by blah\" or \"the given binary should be a= vailable\n /// and executable by the current user\".\n ///\n /// F= or more detail on expect message styles and the reasoning behind our\n /= // recommendation please refer to the section on [\"Common Message\n ///= Styles\"](../../std/error/index.html#common-message-styles) in the [`std::= error`](../../std/error/index.html) module docs.\n #[inline]\n #[trac= k_caller]\n #[stable(feature =3D \"rust1\", since =3D \"1.0.0\")]\n #= [rustc_const_unstable(feature =3D \"const_option\", issue =3D \"67441\")]\n= pub const fn expect(self, msg: &str) -> T {\n match self {\n = Some(val) =3D> val,\n None =3D> expect_failed(msg),\n = }\n }\n\n /// Returns the contained [`Some`] value, consuming th= e `self` value.\n ///\n /// Because this function may panic, its use = is generally discouraged.\n /// Instead, prefer to use pattern matching = and handle the [`None`]\n /// case explicitly, or call [`unwrap_or`], [`= unwrap_or_else`], or\n /// [`unwrap_or_default`].\n ///\n /// [`un= wrap_or`]: Option::unwrap_or\n /// [`unwrap_or_else`]: Option::unwrap_or= _else\n /// [`unwrap_or_default`]: Option::unwrap_or_default\n ///\n = /// # Panics\n ///\n /// Panics if the self value equals [`None`].= \n ///\n /// # Examples\n ///\n /// ```\n /// let x =3D Some= (\"air\");\n /// assert_eq!(x.unwrap(), \"air\");\n /// ```\n ///\= n /// ```should_panic\n /// let x: Option<&str> =3D None;\n /// as= sert_eq!(x.unwrap(), \"air\"); // fails\n /// ```\n #[inline]\n #[= track_caller]\n #[stable(feature =3D \"rust1\", since =3D \"1.0.0\")]\n = #[rustc_const_unstable(feature =3D \"const_option\", issue =3D \"67441\"= )]\n pub const fn unwrap(self) -> T {\n match self {\n = Some(val) =3D> val,\n None =3D> panic(\"called `Option::unwrap(= )` on a `None` value\"),\n }\n }\n\n /// Returns the contained= [`Some`] value or a provided default.\n ///\n /// Arguments passed t= o `unwrap_or` are eagerly evaluated; if you are passing\n /// the result= of a function call, it is recommended to use [`unwrap_or_else`],\n /// = which is lazily evaluated.\n ///\n /// [`unwrap_or_else`]: Option::un= wrap_or_else\n ///\n /// # Examples\n ///\n /// ```\n /// as= sert_eq!(Some(\"car\").unwrap_or(\"bike\"), \"car\");\n /// assert_eq!(N= one.unwrap_or(\"bike\"), \"bike\");\n /// ```\n #[inline]\n #[stab= le(feature =3D \"rust1\", since =3D \"1.0.0\")]\n #[rustc_const_unstable= (feature =3D \"const_option_ext\", issue =3D \"91930\")]\n pub const fn = unwrap_or(self, default: T) -> T\n where\n T: ~const Destruct,\n = {\n match self {\n Some(x) =3D> x,\n None = =3D> default,\n }\n }\n\n /// Returns the contained [`Some`] v= alue or computes it from a closure.\n ///\n /// # Examples\n ///\n= /// ```\n /// let k =3D 10;\n /// assert_eq!(Some(4).unwrap_or_el= se(|| 2 * k), 4);\n /// assert_eq!(None.unwrap_or_else(|| 2 * k), 20);\n= /// ```\n #[inline]\n #[stable(feature =3D \"rust1\", since =3D \= "1.0.0\")]\n #[rustc_const_unstable(feature =3D \"const_option_ext\", is= sue =3D \"91930\")]\n pub const fn unwrap_or_else(self, f: F) -> T\n = where\n F: ~const FnOnce() -> T,\n F: ~const Destruct,\n = {\n match self {\n Some(x) =3D> x,\n None = =3D> f(),\n }\n }\n\n /// Returns the contained [`Some`] value= or a default.\n ///\n /// Consumes the `self` argument then, if [`So= me`], returns the contained\n /// value, otherwise if [`None`], returns = the [default value] for that\n /// type.\n ///\n /// # Examples\n = ///\n /// Converts a string to an integer, turning poorly-formed stri= ngs\n /// into 0 (the default value for integers). [`parse`] converts\n = /// a string to any other type that implements [`FromStr`], returning\n = /// [`None`] on error.\n ///\n /// ```\n /// let good_year_from= _input =3D \"1909\";\n /// let bad_year_from_input =3D \"190blarg\";\n = /// let good_year =3D good_year_from_input.parse().ok().unwrap_or_default= ();\n /// let bad_year =3D bad_year_from_input.parse().ok().unwrap_or_de= fault();\n ///\n /// assert_eq!(1909, good_year);\n /// assert_eq!= (0, bad_year);\n /// ```\n ///\n /// [default value]: Default::def= ault\n /// [`parse`]: str::parse\n /// [`FromStr`]: crate::str::FromS= tr\n #[inline]\n #[stable(feature =3D \"rust1\", since =3D \"1.0.0\")= ]\n #[rustc_const_unstable(feature =3D \"const_option_ext\", issue =3D \= "91930\")]\n pub const fn unwrap_or_default(self) -> T\n where\n = T: ~const Default,\n {\n match self {\n Some(x) =3D= > x,\n None =3D> Default::default(),\n }\n }\n\n //= / Returns the contained [`Some`] value, consuming the `self` value,\n //= / without checking that the value is not [`None`].\n ///\n /// # Safe= ty\n ///\n /// Calling this method on [`None`] is *[undefined behavio= r]*.\n ///\n /// [undefined behavior]: https://doc.rust-lang.org/refe= rence/behavior-considered-undefined.html\n ///\n /// # Examples\n = ///\n /// ```\n /// let x =3D Some(\"air\");\n /// assert_eq!(unsa= fe { x.unwrap_unchecked() }, \"air\");\n /// ```\n ///\n /// ```no= _run\n /// let x: Option<&str> =3D None;\n /// assert_eq!(unsafe { x.= unwrap_unchecked() }, \"air\"); // Undefined behavior!\n /// ```\n #[= inline]\n #[track_caller]\n #[stable(feature =3D \"option_result_unwr= ap_unchecked\", since =3D \"1.58.0\")]\n #[rustc_const_unstable(feature = =3D \"const_option_ext\", issue =3D \"91930\")]\n pub const unsafe fn un= wrap_unchecked(self) -> T {\n debug_assert!(self.is_some());\n = match self {\n Some(val) =3D> val,\n // SAFETY: the= safety contract must be upheld by the caller.\n None =3D> unsaf= e { hint::unreachable_unchecked() },\n }\n }\n\n /////////////= ////////////////////////////////////////////////////////////\n // Transf= orming contained values\n //////////////////////////////////////////////= ///////////////////////////\n\n /// Maps an `Option` to `Option` b= y applying a function to a contained value.\n ///\n /// # Examples\n = ///\n /// Converts an Option<[String]> into an Opt= ion<[usize]>, consuming\n /// the original:\n ///\n /// [St= ring]: ../../std/string/struct.String.html \"String\"\n /// ```\n ///= let maybe_some_string =3D Some(String::from(\"Hello, World!\"));\n /// = // `Option::map` takes self *by value*, consuming `maybe_some_string`\n = /// let maybe_some_len =3D maybe_some_string.map(|s| s.len());\n ///\n = /// assert_eq!(maybe_some_len, Some(13));\n /// ```\n #[inline]\n = #[stable(feature =3D \"rust1\", since =3D \"1.0.0\")]\n #[rustc_const_= unstable(feature =3D \"const_option_ext\", issue =3D \"91930\")]\n pub c= onst fn map(self, f: F) -> Option\n where\n F: ~const Fn= Once(T) -> U,\n F: ~const Destruct,\n {\n match self {\n = Some(x) =3D> Some(f(x)),\n None =3D> None,\n }\= n }\n\n /// Calls the provided closure with a reference to the contai= ned value (if [`Some`]).\n ///\n /// # Examples\n ///\n /// ```= \n /// #![feature(result_option_inspect)]\n ///\n /// let v =3D ve= c![1, 2, 3, 4, 5];\n ///\n /// // prints \"got: 4\"\n /// let x: O= ption<&usize> =3D v.get(3).inspect(|x| println!(\"got: {x}\"));\n ///\n = /// // prints nothing\n /// let x: Option<&usize> =3D v.get(5).inspec= t(|x| println!(\"got: {x}\"));\n /// ```\n #[inline]\n #[unstable(= feature =3D \"result_option_inspect\", issue =3D \"91345\")]\n #[rustc_c= onst_unstable(feature =3D \"const_option_ext\", issue =3D \"91930\")]\n = pub const fn inspect(self, f: F) -> Self\n where\n F: ~const F= nOnce(&T),\n F: ~const Destruct,\n {\n if let Some(ref x) = =3D self {\n f(x);\n }\n\n self\n }\n\n /// = Returns the provided default result (if none),\n /// or applies a functi= on to the contained value (if any).\n ///\n /// Arguments passed to `= map_or` are eagerly evaluated; if you are passing\n /// the result of a = function call, it is recommended to use [`map_or_else`],\n /// which is = lazily evaluated.\n ///\n /// [`map_or_else`]: Option::map_or_else\n = ///\n /// # Examples\n ///\n /// ```\n /// let x =3D Some(\"= foo\");\n /// assert_eq!(x.map_or(42, |v| v.len()), 3);\n ///\n //= / let x: Option<&str> =3D None;\n /// assert_eq!(x.map_or(42, |v| v.len(= )), 42);\n /// ```\n #[inline]\n #[stable(feature =3D \"rust1\", s= ince =3D \"1.0.0\")]\n #[rustc_const_unstable(feature =3D \"const_option= _ext\", issue =3D \"91930\")]\n pub const fn map_or(self, default:= U, f: F) -> U\n where\n F: ~const FnOnce(T) -> U,\n F: ~c= onst Destruct,\n U: ~const Destruct,\n {\n match self {\n = Some(t) =3D> f(t),\n None =3D> default,\n }\n = }\n\n /// Computes a default function result (if none), or\n /// a= pplies a different function to the contained value (if any).\n ///\n = /// # Examples\n ///\n /// ```\n /// let k =3D 21;\n ///\n /= // let x =3D Some(\"foo\");\n /// assert_eq!(x.map_or_else(|| 2 * k, |v|= v.len()), 3);\n ///\n /// let x: Option<&str> =3D None;\n /// ass= ert_eq!(x.map_or_else(|| 2 * k, |v| v.len()), 42);\n /// ```\n #[inli= ne]\n #[stable(feature =3D \"rust1\", since =3D \"1.0.0\")]\n #[rustc= _const_unstable(feature =3D \"const_option_ext\", issue =3D \"91930\")]\n = pub const fn map_or_else(self, default: D, f: F) -> U\n where= \n D: ~const FnOnce() -> U,\n D: ~const Destruct,\n F:= ~const FnOnce(T) -> U,\n F: ~const Destruct,\n {\n match = self {\n Some(t) =3D> f(t),\n None =3D> default(),\n = }\n }\n\n /// Transforms the `Option` into a [`Result= `], mapping [`Some(v)`] to\n /// [`Ok(v)`] and [`None`] to [`Err(err)`].= \n ///\n /// Arguments passed to `ok_or` are eagerly evaluated; if yo= u are passing the\n /// result of a function call, it is recommended to = use [`ok_or_else`], which is\n /// lazily evaluated.\n ///\n /// [= `Ok(v)`]: Ok\n /// [`Err(err)`]: Err\n /// [`Some(v)`]: Some\n ///= [`ok_or_else`]: Option::ok_or_else\n ///\n /// # Examples\n ///\n= /// ```\n /// let x =3D Some(\"foo\");\n /// assert_eq!(x.ok_or(0= ), Ok(\"foo\"));\n ///\n /// let x: Option<&str> =3D None;\n /// a= ssert_eq!(x.ok_or(0), Err(0));\n /// ```\n #[inline]\n #[stable(fe= ature =3D \"rust1\", since =3D \"1.0.0\")]\n #[rustc_const_unstable(feat= ure =3D \"const_option_ext\", issue =3D \"91930\")]\n pub const fn ok_or= (self, err: E) -> Result\n where\n E: ~const Destruct,\n= {\n match self {\n Some(v) =3D> Ok(v),\n N= one =3D> Err(err),\n }\n }\n\n /// Transforms the `Option` = into a [`Result`], mapping [`Some(v)`] to\n /// [`Ok(v)`] and [`No= ne`] to [`Err(err())`].\n ///\n /// [`Ok(v)`]: Ok\n /// [`Err(err(= ))`]: Err\n /// [`Some(v)`]: Some\n ///\n /// # Examples\n ///\= n /// ```\n /// let x =3D Some(\"foo\");\n /// assert_eq!(x.ok_or_= else(|| 0), Ok(\"foo\"));\n ///\n /// let x: Option<&str> =3D None;\n= /// assert_eq!(x.ok_or_else(|| 0), Err(0));\n /// ```\n #[inline]= \n #[stable(feature =3D \"rust1\", since =3D \"1.0.0\")]\n #[rustc_co= nst_unstable(feature =3D \"const_option_ext\", issue =3D \"91930\")]\n p= ub const fn ok_or_else(self, err: F) -> Result\n where\n = F: ~const FnOnce() -> E,\n F: ~const Destruct,\n {\n m= atch self {\n Some(v) =3D> Ok(v),\n None =3D> Err(err= ()),\n }\n }\n\n /// Converts from `Option` (or `&Option= `) to `Option<&T::Target>`.\n ///\n /// Leaves the original Option in= -place, creating a new one with a reference\n /// to the original one, a= dditionally coercing the contents via [`Deref`].\n ///\n /// # Exampl= es\n ///\n /// ```\n /// let x: Option =3D Some(\"hey\".to= _owned());\n /// assert_eq!(x.as_deref(), Some(\"hey\"));\n ///\n = /// let x: Option =3D None;\n /// assert_eq!(x.as_deref(), None)= ;\n /// ```\n #[stable(feature =3D \"option_deref\", since =3D \"1.40= .0\")]\n #[rustc_const_unstable(feature =3D \"const_option_ext\", issue = =3D \"91930\")]\n pub const fn as_deref(&self) -> Option<&T::Target>\n = where\n T: ~const Deref,\n {\n match self.as_ref() {\n = Some(t) =3D> Some(t.deref()),\n None =3D> None,\n = }\n }\n\n /// Converts from `Option` (or `&mut Option`) to `= Option<&mut T::Target>`.\n ///\n /// Leaves the original `Option` in-= place, creating a new one containing a mutable reference to\n /// the in= ner type's [`Deref::Target`] type.\n ///\n /// # Examples\n ///\n = /// ```\n /// let mut x: Option =3D Some(\"hey\".to_owned());= \n /// assert_eq!(x.as_deref_mut().map(|x| {\n /// x.make_ascii_u= ppercase();\n /// x\n /// }), Some(\"HEY\".to_owned().as_mut_str(= )));\n /// ```\n #[stable(feature =3D \"option_deref\", since =3D \"1= .40.0\")]\n #[rustc_const_unstable(feature =3D \"const_option_ext\", iss= ue =3D \"91930\")]\n pub const fn as_deref_mut(&mut self) -> Option<&mut= T::Target>\n where\n T: ~const DerefMut,\n {\n match s= elf.as_mut() {\n Some(t) =3D> Some(t.deref_mut()),\n = None =3D> None,\n }\n }\n\n //////////////////////////////////= ///////////////////////////////////////\n // Iterator constructors\n = /////////////////////////////////////////////////////////////////////////\n= \n /// Returns an iterator over the possibly contained value.\n ///\n= /// # Examples\n ///\n /// ```\n /// let x =3D Some(4);\n /= // assert_eq!(x.iter().next(), Some(&4));\n ///\n /// let x: Option =3D None;\n /// assert_eq!(x.iter().next(), None);\n /// ```\n = #[inline]\n #[rustc_const_unstable(feature =3D \"const_option\", issue = =3D \"67441\")]\n #[stable(feature =3D \"rust1\", since =3D \"1.0.0\")]\= n pub const fn iter(&self) -> Iter<'_, T> {\n Iter { inner: Item = { opt: self.as_ref() } }\n }\n\n /// Returns a mutable iterator over = the possibly contained value.\n ///\n /// # Examples\n ///\n //= / ```\n /// let mut x =3D Some(4);\n /// match x.iter_mut().next() {\= n /// Some(v) =3D> *v =3D 42,\n /// None =3D> {},\n /// }\= n /// assert_eq!(x, Some(42));\n ///\n /// let mut x: Option = =3D None;\n /// assert_eq!(x.iter_mut().next(), None);\n /// ```\n = #[inline]\n #[stable(feature =3D \"rust1\", since =3D \"1.0.0\")]\n = pub fn iter_mut(&mut self) -> IterMut<'_, T> {\n IterMut { inner: It= em { opt: self.as_mut() } }\n }\n\n /////////////////////////////////= ////////////////////////////////////////\n // Boolean operations on the = values, eager and lazy\n ///////////////////////////////////////////////= //////////////////////////\n\n /// Returns [`None`] if the option is [`N= one`], otherwise returns `optb`.\n ///\n /// # Examples\n ///\n = /// ```\n /// let x =3D Some(2);\n /// let y: Option<&str> =3D None;= \n /// assert_eq!(x.and(y), None);\n ///\n /// let x: Option = =3D None;\n /// let y =3D Some(\"foo\");\n /// assert_eq!(x.and(y), N= one);\n ///\n /// let x =3D Some(2);\n /// let y =3D Some(\"foo\")= ;\n /// assert_eq!(x.and(y), Some(\"foo\"));\n ///\n /// let x: Op= tion =3D None;\n /// let y: Option<&str> =3D None;\n /// assert_= eq!(x.and(y), None);\n /// ```\n #[inline]\n #[stable(feature =3D = \"rust1\", since =3D \"1.0.0\")]\n #[rustc_const_unstable(feature =3D \"= const_option_ext\", issue =3D \"91930\")]\n pub const fn and(self, op= tb: Option) -> Option\n where\n T: ~const Destruct,\n = U: ~const Destruct,\n {\n match self {\n Some(_) =3D= > optb,\n None =3D> None,\n }\n }\n\n /// Returns [= `None`] if the option is [`None`], otherwise calls `f` with the\n /// wr= apped value and returns the result.\n ///\n /// Some languages call t= his operation flatmap.\n ///\n /// # Examples\n ///\n /// ```\n= /// fn sq_then_to_string(x: u32) -> Option {\n /// x.che= cked_mul(x).map(|sq| sq.to_string())\n /// }\n ///\n /// assert_eq= !(Some(2).and_then(sq_then_to_string), Some(4.to_string()));\n /// asser= t_eq!(Some(1_000_000).and_then(sq_then_to_string), None); // overflowed!\n = /// assert_eq!(None.and_then(sq_then_to_string), None);\n /// ```\n = ///\n /// Often used to chain fallible operations that may return [`No= ne`].\n ///\n /// ```\n /// let arr_2d =3D [[\"A0\", \"A1\"], [\"B= 0\", \"B1\"]];\n ///\n /// let item_0_1 =3D arr_2d.get(0).and_then(|r= ow| row.get(1));\n /// assert_eq!(item_0_1, Some(&\"A1\"));\n ///\n = /// let item_2_0 =3D arr_2d.get(2).and_then(|row| row.get(0));\n /// a= ssert_eq!(item_2_0, None);\n /// ```\n #[inline]\n #[stable(featur= e =3D \"rust1\", since =3D \"1.0.0\")]\n #[rustc_const_unstable(feature = =3D \"const_option_ext\", issue =3D \"91930\")]\n pub const fn and_then<= U, F>(self, f: F) -> Option\n where\n F: ~const FnOnce(T) -> O= ption,\n F: ~const Destruct,\n {\n match self {\n = Some(x) =3D> f(x),\n None =3D> None,\n }\n }\n\n= /// Returns [`None`] if the option is [`None`], otherwise calls `predic= ate`\n /// with the wrapped value and returns:\n ///\n /// - [`Som= e(t)`] if `predicate` returns `true` (where `t` is the wrapped\n /// v= alue), and\n /// - [`None`] if `predicate` returns `false`.\n ///\n = /// This function works similar to [`Iterator::filter()`]. You can imagin= e\n /// the `Option` being an iterator over one or zero elements. `fi= lter()`\n /// lets you decide which elements to keep.\n ///\n /// = # Examples\n ///\n /// ```rust\n /// fn is_even(n: &i32) -> bool {= \n /// n % 2 =3D=3D 0\n /// }\n ///\n /// assert_eq!(None.f= ilter(is_even), None);\n /// assert_eq!(Some(3).filter(is_even), None);\= n /// assert_eq!(Some(4).filter(is_even), Some(4));\n /// ```\n //= /\n /// [`Some(t)`]: Some\n #[inline]\n #[stable(feature =3D \"opt= ion_filter\", since =3D \"1.27.0\")]\n #[rustc_const_unstable(feature = =3D \"const_option_ext\", issue =3D \"91930\")]\n pub const fn filter

= (self, predicate: P) -> Self\n where\n T: ~const Destruct,\n = P: ~const FnOnce(&T) -> bool,\n P: ~const Destruct,\n {\n = if let Some(x) =3D self {\n if predicate(&x) {\n = return Some(x);\n }\n }\n None\n }\n\n //= / Returns the option if it contains a value, otherwise returns `optb`.\n = ///\n /// Arguments passed to `or` are eagerly evaluated; if you are pa= ssing the\n /// result of a function call, it is recommended to use [`or= _else`], which is\n /// lazily evaluated.\n ///\n /// [`or_else`]:= Option::or_else\n ///\n /// # Examples\n ///\n /// ```\n //= / let x =3D Some(2);\n /// let y =3D None;\n /// assert_eq!(x.or(y), = Some(2));\n ///\n /// let x =3D None;\n /// let y =3D Some(100);\n= /// assert_eq!(x.or(y), Some(100));\n ///\n /// let x =3D Some(2)= ;\n /// let y =3D Some(100);\n /// assert_eq!(x.or(y), Some(2));\n = ///\n /// let x: Option =3D None;\n /// let y =3D None;\n //= / assert_eq!(x.or(y), None);\n /// ```\n #[inline]\n #[stable(feat= ure =3D \"rust1\", since =3D \"1.0.0\")]\n #[rustc_const_unstable(featur= e =3D \"const_option_ext\", issue =3D \"91930\")]\n pub const fn or(self= , optb: Option) -> Option\n where\n T: ~const Destruct,\n = {\n match self {\n Some(x) =3D> Some(x),\n N= one =3D> optb,\n }\n }\n\n /// Returns the option if it contai= ns a value, otherwise calls `f` and\n /// returns the result.\n ///\n= /// # Examples\n ///\n /// ```\n /// fn nobody() -> Option<&'s= tatic str> { None }\n /// fn vikings() -> Option<&'static str> { Some(\"= vikings\") }\n ///\n /// assert_eq!(Some(\"barbarians\").or_else(viki= ngs), Some(\"barbarians\"));\n /// assert_eq!(None.or_else(vikings), Som= e(\"vikings\"));\n /// assert_eq!(None.or_else(nobody), None);\n /// = ```\n #[inline]\n #[stable(feature =3D \"rust1\", since =3D \"1.0.0\"= )]\n #[rustc_const_unstable(feature =3D \"const_option_ext\", issue =3D = \"91930\")]\n pub const fn or_else(self, f: F) -> Option\n wher= e\n F: ~const FnOnce() -> Option,\n F: ~const Destruct,\n = {\n match self {\n Some(x) =3D> Some(x),\n = None =3D> f(),\n }\n }\n\n /// Returns [`Some`] if exactly one= of `self`, `optb` is [`Some`], otherwise returns [`None`].\n ///\n /= // # Examples\n ///\n /// ```\n /// let x =3D Some(2);\n /// le= t y: Option =3D None;\n /// assert_eq!(x.xor(y), Some(2));\n ///= \n /// let x: Option =3D None;\n /// let y =3D Some(2);\n ///= assert_eq!(x.xor(y), Some(2));\n ///\n /// let x =3D Some(2);\n /= // let y =3D Some(2);\n /// assert_eq!(x.xor(y), None);\n ///\n //= / let x: Option =3D None;\n /// let y: Option =3D None;\n /= // assert_eq!(x.xor(y), None);\n /// ```\n #[inline]\n #[stable(fe= ature =3D \"option_xor\", since =3D \"1.37.0\")]\n #[rustc_const_unstabl= e(feature =3D \"const_option_ext\", issue =3D \"91930\")]\n pub const fn= xor(self, optb: Option) -> Option\n where\n T: ~const Dest= ruct,\n {\n match (self, optb) {\n (Some(a), None) =3D= > Some(a),\n (None, Some(b)) =3D> Some(b),\n _ =3D> N= one,\n }\n }\n\n /////////////////////////////////////////////= ////////////////////////////\n // Entry-like operations to insert a valu= e and return a reference\n /////////////////////////////////////////////= ////////////////////////////\n\n /// Inserts `value` into the option, th= en returns a mutable reference to it.\n ///\n /// If the option alrea= dy contains a value, the old value is dropped.\n ///\n /// See also [= `Option::get_or_insert`], which doesn't update the value if\n /// the op= tion already contains [`Some`].\n ///\n /// # Example\n ///\n /= // ```\n /// let mut opt =3D None;\n /// let val =3D opt.insert(1);\n= /// assert_eq!(*val, 1);\n /// assert_eq!(opt.unwrap(), 1);\n ///= let val =3D opt.insert(2);\n /// assert_eq!(*val, 2);\n /// *val =3D= 3;\n /// assert_eq!(opt.unwrap(), 3);\n /// ```\n #[must_use =3D = \"if you intended to set a value, consider assignment instead\"]\n #[inl= ine]\n #[stable(feature =3D \"option_insert\", since =3D \"1.53.0\")]\n = #[rustc_const_unstable(feature =3D \"const_option_ext\", issue =3D \"919= 30\")]\n pub const fn insert(&mut self, value: T) -> &mut T\n where\n= T: ~const Destruct,\n {\n *self =3D Some(value);\n\n = // SAFETY: the code above just filled the option\n unsafe { self.= as_mut().unwrap_unchecked() }\n }\n\n /// Inserts `value` into the op= tion if it is [`None`], then\n /// returns a mutable reference to the co= ntained value.\n ///\n /// See also [`Option::insert`], which updates= the value even if\n /// the option already contains [`Some`].\n ///\= n /// # Examples\n ///\n /// ```\n /// let mut x =3D None;\n = ///\n /// {\n /// let y: &mut u32 =3D x.get_or_insert(5);\n /= // assert_eq!(y, &5);\n ///\n /// *y =3D 7;\n /// }\n /= //\n /// assert_eq!(x, Some(7));\n /// ```\n #[inline]\n #[stab= le(feature =3D \"option_entry\", since =3D \"1.20.0\")]\n #[rustc_const_= unstable(feature =3D \"const_option_ext\", issue =3D \"91930\")]\n pub c= onst fn get_or_insert(&mut self, value: T) -> &mut T\n where\n T:= ~const Destruct,\n {\n if let None =3D *self {\n *sel= f =3D Some(value);\n }\n\n // SAFETY: a `None` variant for `s= elf` would have been replaced by a `Some`\n // variant in the code a= bove.\n unsafe { self.as_mut().unwrap_unchecked() }\n }\n\n //= / Inserts the default value into the option if it is [`None`], then\n //= / returns a mutable reference to the contained value.\n ///\n /// # E= xamples\n ///\n /// ```\n /// #![feature(option_get_or_insert_defa= ult)]\n ///\n /// let mut x =3D None;\n ///\n /// {\n /// = let y: &mut u32 =3D x.get_or_insert_default();\n /// assert_eq!(y,= &0);\n ///\n /// *y =3D 7;\n /// }\n ///\n /// assert_e= q!(x, Some(7));\n /// ```\n #[inline]\n #[unstable(feature =3D \"o= ption_get_or_insert_default\", issue =3D \"82901\")]\n #[rustc_const_uns= table(feature =3D \"const_option_ext\", issue =3D \"91930\")]\n pub cons= t fn get_or_insert_default(&mut self) -> &mut T\n where\n T: ~con= st Default,\n {\n const fn default() -> T {\n = T::default()\n }\n\n self.get_or_insert_with(defau= lt)\n }\n\n /// Inserts a value computed from `f` into the option if = it is [`None`],\n /// then returns a mutable reference to the contained = value.\n ///\n /// # Examples\n ///\n /// ```\n /// let mut = x =3D None;\n ///\n /// {\n /// let y: &mut u32 =3D x.get_or_i= nsert_with(|| 5);\n /// assert_eq!(y, &5);\n ///\n /// *y = =3D 7;\n /// }\n ///\n /// assert_eq!(x, Some(7));\n /// ```\n = #[inline]\n #[stable(feature =3D \"option_entry\", since =3D \"1.20.0= \")]\n #[rustc_const_unstable(feature =3D \"const_option_ext\", issue = =3D \"91930\")]\n pub const fn get_or_insert_with(&mut self, f: F) ->= &mut T\n where\n F: ~const FnOnce() -> T,\n F: ~const Des= truct,\n {\n if let None =3D *self {\n // the compiler= isn't smart enough to know that we are not dropping a `T`\n // = here and wants us to ensure `T` can be dropped at compile time.\n = mem::forget(mem::replace(self, Some(f())))\n }\n\n // SAFET= Y: a `None` variant for `self` would have been replaced by a `Some`\n = // variant in the code above.\n unsafe { self.as_mut().unwrap_unch= ecked() }\n }\n\n ///////////////////////////////////////////////////= //////////////////////\n // Misc\n //////////////////////////////////= ///////////////////////////////////////\n\n /// Takes the value out of t= he option, leaving a [`None`] in its place.\n ///\n /// # Examples\n = ///\n /// ```\n /// let mut x =3D Some(2);\n /// let y =3D x.ta= ke();\n /// assert_eq!(x, None);\n /// assert_eq!(y, Some(2));\n /= //\n /// let mut x: Option =3D None;\n /// let y =3D x.take();\n= /// assert_eq!(x, None);\n /// assert_eq!(y, None);\n /// ```\n = #[inline]\n #[stable(feature =3D \"rust1\", since =3D \"1.0.0\")]\n = #[rustc_const_unstable(feature =3D \"const_option\", issue =3D \"67441\")]= \n pub const fn take(&mut self) -> Option {\n // FIXME replace= `mem::replace` by `mem::take` when the latter is const ready\n mem:= :replace(self, None)\n }\n\n /// Replaces the actual value in the opt= ion by the value given in parameter,\n /// returning the old value if pr= esent,\n /// leaving a [`Some`] in its place without deinitializing eith= er one.\n ///\n /// # Examples\n ///\n /// ```\n /// let mut= x =3D Some(2);\n /// let old =3D x.replace(5);\n /// assert_eq!(x, S= ome(5));\n /// assert_eq!(old, Some(2));\n ///\n /// let mut x =3D= None;\n /// let old =3D x.replace(3);\n /// assert_eq!(x, Some(3));\= n /// assert_eq!(old, None);\n /// ```\n #[inline]\n #[rustc_co= nst_unstable(feature =3D \"const_option\", issue =3D \"67441\")]\n #[sta= ble(feature =3D \"option_replace\", since =3D \"1.31.0\")]\n pub const f= n replace(&mut self, value: T) -> Option {\n mem::replace(self, S= ome(value))\n }\n\n /// Returns `true` if the option is a [`Some`] va= lue containing the given value.\n ///\n /// # Examples\n ///\n = /// ```\n /// #![feature(option_result_contains)]\n ///\n /// let = x: Option =3D Some(2);\n /// assert_eq!(x.contains(&2), true);\n = ///\n /// let x: Option =3D Some(3);\n /// assert_eq!(x.contain= s(&2), false);\n ///\n /// let x: Option =3D None;\n /// asse= rt_eq!(x.contains(&2), false);\n /// ```\n #[must_use]\n #[inline]= \n #[unstable(feature =3D \"option_result_contains\", issue =3D \"62358\= ")]\n #[rustc_const_unstable(feature =3D \"const_option_ext\", issue =3D= \"91930\")]\n pub const fn contains(&self, x: &U) -> bool\n where= \n U: ~const PartialEq,\n {\n match self {\n = Some(y) =3D> x.eq(y),\n None =3D> false,\n }\n }\n\n = /// Zips `self` with another `Option`.\n ///\n /// If `self` is `S= ome(s)` and `other` is `Some(o)`, this method returns `Some((s, o))`.\n = /// Otherwise, `None` is returned.\n ///\n /// # Examples\n ///\n = /// ```\n /// let x =3D Some(1);\n /// let y =3D Some(\"hi\");\n = /// let z =3D None::;\n ///\n /// assert_eq!(x.zip(y), Some((1,= \"hi\")));\n /// assert_eq!(x.zip(z), None);\n /// ```\n #[stable= (feature =3D \"option_zip_option\", since =3D \"1.46.0\")]\n #[rustc_con= st_unstable(feature =3D \"const_option_ext\", issue =3D \"91930\")]\n pu= b const fn zip(self, other: Option) -> Option<(T, U)>\n where\n = T: ~const Destruct,\n U: ~const Destruct,\n {\n match= (self, other) {\n (Some(a), Some(b)) =3D> Some((a, b)),\n = _ =3D> None,\n }\n }\n\n /// Zips `self` and another `Op= tion` with function `f`.\n ///\n /// If `self` is `Some(s)` and `othe= r` is `Some(o)`, this method returns `Some(f(s, o))`.\n /// Otherwise, `= None` is returned.\n ///\n /// # Examples\n ///\n /// ```\n = /// #![feature(option_zip)]\n ///\n /// #[derive(Debug, PartialEq)]\n= /// struct Point {\n /// x: f64,\n /// y: f64,\n /// }= \n ///\n /// impl Point {\n /// fn new(x: f64, y: f64) -> Self= {\n /// Self { x, y }\n /// }\n /// }\n ///\n /= // let x =3D Some(17.5);\n /// let y =3D Some(42.7);\n ///\n /// a= ssert_eq!(x.zip_with(y, Point::new), Some(Point { x: 17.5, y: 42.7 }));\n = /// assert_eq!(x.zip_with(None, Point::new), None);\n /// ```\n #[u= nstable(feature =3D \"option_zip\", issue =3D \"70086\")]\n #[rustc_cons= t_unstable(feature =3D \"const_option_ext\", issue =3D \"91930\")]\n pub= const fn zip_with(self, other: Option, f: F) -> Option\n = where\n F: ~const FnOnce(T, U) -> R,\n F: ~const Destruct,\n= T: ~const Destruct,\n U: ~const Destruct,\n {\n ma= tch (self, other) {\n (Some(a), Some(b)) =3D> Some(f(a, b)),\n = _ =3D> None,\n }\n }\n}\n\nimpl Option<(T, U)> {\= n /// Unzips an option containing a tuple of two options.\n ///\n = /// If `self` is `Some((a, b))` this method returns `(Some(a), Some(b))`.\n= /// Otherwise, `(None, None)` is returned.\n ///\n /// # Examples= \n ///\n /// ```\n /// #![feature(unzip_option)]\n ///\n ///= let x =3D Some((1, \"hi\"));\n /// let y =3D None::<(u8, u32)>;\n //= /\n /// assert_eq!(x.unzip(), (Some(1), Some(\"hi\")));\n /// assert_= eq!(y.unzip(), (None, None));\n /// ```\n #[inline]\n #[unstable(f= eature =3D \"unzip_option\", issue =3D \"87800\", reason =3D \"recently add= ed\")]\n pub const fn unzip(self) -> (Option, Option) {\n m= atch self {\n Some((a, b)) =3D> (Some(a), Some(b)),\n = None =3D> (None, None),\n }\n }\n}\n\nimpl Option<&T> {\n = /// Maps an `Option<&T>` to an `Option` by copying the contents of the\n= /// option.\n ///\n /// # Examples\n ///\n /// ```\n ///= let x =3D 12;\n /// let opt_x =3D Some(&x);\n /// assert_eq!(opt_x, = Some(&12));\n /// let copied =3D opt_x.copied();\n /// assert_eq!(cop= ied, Some(12));\n /// ```\n #[must_use =3D \"`self` will be dropped i= f the result is not used\"]\n #[stable(feature =3D \"copied\", since =3D= \"1.35.0\")]\n #[rustc_const_unstable(feature =3D \"const_option\", iss= ue =3D \"67441\")]\n pub const fn copied(self) -> Option\n where\n= T: Copy,\n {\n // FIXME: this implementation, which sides= teps using `Option::map` since it's not const\n // ready yet, should= be reverted when possible to avoid code repetition\n match self {\n= Some(&v) =3D> Some(v),\n None =3D> None,\n }\= n }\n\n /// Maps an `Option<&T>` to an `Option` by cloning the con= tents of the\n /// option.\n ///\n /// # Examples\n ///\n //= / ```\n /// let x =3D 12;\n /// let opt_x =3D Some(&x);\n /// asse= rt_eq!(opt_x, Some(&12));\n /// let cloned =3D opt_x.cloned();\n /// = assert_eq!(cloned, Some(12));\n /// ```\n #[must_use =3D \"`self` wil= l be dropped if the result is not used\"]\n #[stable(feature =3D \"rust1= \", since =3D \"1.0.0\")]\n #[rustc_const_unstable(feature =3D \"const_o= ption_cloned\", issue =3D \"91582\")]\n pub const fn cloned(self) -> Opt= ion\n where\n T: ~const Clone,\n {\n match self {\n = Some(t) =3D> Some(t.clone()),\n None =3D> None,\n = }\n }\n}\n\nimpl Option<&mut T> {\n /// Maps an `Option<&mut T= >` to an `Option` by copying the contents of the\n /// option.\n /= //\n /// # Examples\n ///\n /// ```\n /// let mut x =3D 12;\n = /// let opt_x =3D Some(&mut x);\n /// assert_eq!(opt_x, Some(&mut 12))= ;\n /// let copied =3D opt_x.copied();\n /// assert_eq!(copied, Some(= 12));\n /// ```\n #[must_use =3D \"`self` will be dropped if the resu= lt is not used\"]\n #[stable(feature =3D \"copied\", since =3D \"1.35.0\= ")]\n #[rustc_const_unstable(feature =3D \"const_option_ext\", issue =3D= \"91930\")]\n pub const fn copied(self) -> Option\n where\n = T: Copy,\n {\n match self {\n Some(&mut t) =3D> Some= (t),\n None =3D> None,\n }\n }\n\n /// Maps an `Opt= ion<&mut T>` to an `Option` by cloning the contents of the\n /// opti= on.\n ///\n /// # Examples\n ///\n /// ```\n /// let mut x = =3D 12;\n /// let opt_x =3D Some(&mut x);\n /// assert_eq!(opt_x, Som= e(&mut 12));\n /// let cloned =3D opt_x.cloned();\n /// assert_eq!(cl= oned, Some(12));\n /// ```\n #[must_use =3D \"`self` will be dropped = if the result is not used\"]\n #[stable(since =3D \"1.26.0\", feature = =3D \"option_ref_mut_cloned\")]\n #[rustc_const_unstable(feature =3D \"c= onst_option_cloned\", issue =3D \"91582\")]\n pub const fn cloned(self) = -> Option\n where\n T: ~const Clone,\n {\n match sel= f {\n Some(t) =3D> Some(t.clone()),\n None =3D> None,= \n }\n }\n}\n\nimpl Option> {\n /// Transpo= ses an `Option` of a [`Result`] into a [`Result`] of an `Option`.\n ///\= n /// [`None`] will be mapped to [Ok]\\([None]).\n /// <= code>[Some]\\([Ok]\\(\\_)) and [Some]\\([Err]\\(\\_)) w= ill be mapped to\n /// [Ok]\\([Some]\\(\\_)) and [Err= ]\\(\\_).\n ///\n /// # Examples\n ///\n /// ```\n //= / #[derive(Debug, Eq, PartialEq)]\n /// struct SomeErr;\n ///\n //= / let x: Result, SomeErr> =3D Ok(Some(5));\n /// let y: Opti= on> =3D Some(Ok(5));\n /// assert_eq!(x, y.transpos= e());\n /// ```\n #[inline]\n #[stable(feature =3D \"transpose_res= ult\", since =3D \"1.33.0\")]\n #[rustc_const_unstable(feature =3D \"con= st_option\", issue =3D \"67441\")]\n pub const fn transpose(self) -> Res= ult, E> {\n match self {\n Some(Ok(x)) =3D> Ok(= Some(x)),\n Some(Err(e)) =3D> Err(e),\n None =3D> Ok(= None),\n }\n }\n}\n\n// This is a separate function to reduce the= code size of .expect() itself.\n#[cfg_attr(not(feature =3D \"panic_immedia= te_abort\"), inline(never))]\n#[cfg_attr(feature =3D \"panic_immediate_abor= t\", inline)]\n#[cold]\n#[track_caller]\n#[rustc_const_unstable(feature =3D= \"const_option\", issue =3D \"67441\")]\nconst fn expect_failed(msg: &str)= -> ! {\n panic_str(msg)\n}\n\n/////////////////////////////////////////= ////////////////////////////////////\n// Trait implementations\n///////////= //////////////////////////////////////////////////////////////////\n\n#[sta= ble(feature =3D \"rust1\", since =3D \"1.0.0\")]\n#[rustc_const_unstable(fe= ature =3D \"const_clone\", issue =3D \"91805\")]\nimpl const Clone for O= ption\nwhere\n T: ~const Clone + ~const Destruct,\n{\n #[inline]\n= fn clone(&self) -> Self {\n match self {\n Some(x) = =3D> Some(x.clone()),\n None =3D> None,\n }\n }\n\n = #[inline]\n fn clone_from(&mut self, source: &Self) {\n match (s= elf, source) {\n (Some(to), Some(from)) =3D> to.clone_from(from)= ,\n (to, from) =3D> *to =3D from.clone(),\n }\n }\n}\n= \n#[stable(feature =3D \"rust1\", since =3D \"1.0.0\")]\n#[rustc_const_unst= able(feature =3D \"const_default_impls\", issue =3D \"87864\")]\nimpl co= nst Default for Option {\n /// Returns [`None`][Option::None].\n /= //\n /// # Examples\n ///\n /// ```\n /// let opt: Option = =3D Option::default();\n /// assert!(opt.is_none());\n /// ```\n #= [inline]\n fn default() -> Option {\n None\n }\n}\n\n#[stab= le(feature =3D \"rust1\", since =3D \"1.0.0\")]\nimpl IntoIterator for O= ption {\n type Item =3D T;\n type IntoIter =3D IntoIter;\n\n = /// Returns a consuming iterator over the possibly contained value.\n /= //\n /// # Examples\n ///\n /// ```\n /// let x =3D Some(\"stri= ng\");\n /// let v: Vec<&str> =3D x.into_iter().collect();\n /// asse= rt_eq!(v, [\"string\"]);\n ///\n /// let x =3D None;\n /// let v: = Vec<&str> =3D x.into_iter().collect();\n /// assert!(v.is_empty());\n = /// ```\n #[inline]\n fn into_iter(self) -> IntoIter {\n I= ntoIter { inner: Item { opt: self } }\n }\n}\n\n#[stable(since =3D \"1.4= .0\", feature =3D \"option_iter\")]\nimpl<'a, T> IntoIterator for &'a Optio= n {\n type Item =3D &'a T;\n type IntoIter =3D Iter<'a, T>;\n\n = fn into_iter(self) -> Iter<'a, T> {\n self.iter()\n }\n}\n\n#[st= able(since =3D \"1.4.0\", feature =3D \"option_iter\")]\nimpl<'a, T> IntoIt= erator for &'a mut Option {\n type Item =3D &'a mut T;\n type Into= Iter =3D IterMut<'a, T>;\n\n fn into_iter(self) -> IterMut<'a, T> {\n = self.iter_mut()\n }\n}\n\n#[stable(since =3D \"1.12.0\", feature = =3D \"option_from\")]\n#[rustc_const_unstable(feature =3D \"const_convert\"= , issue =3D \"88674\")]\nimpl const From for Option {\n /// Mov= es `val` into a new [`Some`].\n ///\n /// # Examples\n ///\n //= / ```\n /// let o: Option =3D Option::from(67);\n ///\n /// as= sert_eq!(Some(67), o);\n /// ```\n fn from(val: T) -> Option {\n = Some(val)\n }\n}\n\n#[stable(feature =3D \"option_ref_from_ref_opt= ion\", since =3D \"1.30.0\")]\n#[rustc_const_unstable(feature =3D \"const_c= onvert\", issue =3D \"88674\")]\nimpl<'a, T> const From<&'a Option> for = Option<&'a T> {\n /// Converts from `&Option` to `Option<&T>`.\n /= //\n /// # Examples\n ///\n /// Converts an [Option]<[String= ]> into an [Option]<[usize]>, preserving\n /// the o= riginal. The [`map`] method takes the `self` argument by value, consuming t= he original,\n /// so this technique uses `from` to first take an [`Opti= on`] to a reference\n /// to the value inside the original.\n ///\n = /// [`map`]: Option::map\n /// [String]: ../../std/string/struct.Strin= g.html \"String\"\n ///\n /// ```\n /// let s: Option =3D = Some(String::from(\"Hello, Rustaceans!\"));\n /// let o: Option = =3D Option::from(&s).map(|ss: &String| ss.len());\n ///\n /// println= !(\"Can still print s: {s:?}\");\n ///\n /// assert_eq!(o, Some(18));= \n /// ```\n fn from(o: &'a Option) -> Option<&'a T> {\n o.= as_ref()\n }\n}\n\n#[stable(feature =3D \"option_ref_from_ref_option\", = since =3D \"1.30.0\")]\n#[rustc_const_unstable(feature =3D \"const_convert\= ", issue =3D \"88674\")]\nimpl<'a, T> const From<&'a mut Option> for Opt= ion<&'a mut T> {\n /// Converts from `&mut Option` to `Option<&mut T>= `\n ///\n /// # Examples\n ///\n /// ```\n /// let mut s =3D= Some(String::from(\"Hello\"));\n /// let o: Option<&mut String> =3D Opt= ion::from(&mut s);\n ///\n /// match o {\n /// Some(t) =3D> *t= =3D String::from(\"Hello, Rustaceans!\"),\n /// None =3D> (),\n = /// }\n ///\n /// assert_eq!(s, Some(String::from(\"Hello, Rustaceans= !\")));\n /// ```\n fn from(o: &'a mut Option) -> Option<&'a mut T= > {\n o.as_mut()\n }\n}\n\n//////////////////////////////////////= ///////////////////////////////////////\n// The Option Iterators\n/////////= ////////////////////////////////////////////////////////////////////\n\n#[d= erive(Clone, Debug)]\nstruct Item {\n opt: Option,\n}\n\nimpl I= terator for Item {\n type Item =3D A;\n\n #[inline]\n fn next(&= mut self) -> Option {\n self.opt.take()\n }\n\n #[inline]\n= fn size_hint(&self) -> (usize, Option) {\n match self.opt= {\n Some(_) =3D> (1, Some(1)),\n None =3D> (0, Some(= 0)),\n }\n }\n}\n\nimpl DoubleEndedIterator for Item {\n = #[inline]\n fn next_back(&mut self) -> Option {\n self.opt.ta= ke()\n }\n}\n\nimpl ExactSizeIterator for Item {}\nimpl FusedIt= erator for Item {}\nunsafe impl TrustedLen for Item {}\n\n/// An i= terator over a reference to the [`Some`] variant of an [`Option`].\n///\n//= / The iterator yields one value if the [`Option`] is a [`Some`], otherwise = none.\n///\n/// This `struct` is created by the [`Option::iter`] function.\= n#[stable(feature =3D \"rust1\", since =3D \"1.0.0\")]\n#[derive(Debug)]\np= ub struct Iter<'a, A: 'a> {\n inner: Item<&'a A>,\n}\n\n#[stable(feature= =3D \"rust1\", since =3D \"1.0.0\")]\nimpl<'a, A> Iterator for Iter<'a, A>= {\n type Item =3D &'a A;\n\n #[inline]\n fn next(&mut self) -> Op= tion<&'a A> {\n self.inner.next()\n }\n #[inline]\n fn size= _hint(&self) -> (usize, Option) {\n self.inner.size_hint()\n = }\n}\n\n#[stable(feature =3D \"rust1\", since =3D \"1.0.0\")]\nimpl<'a, = A> DoubleEndedIterator for Iter<'a, A> {\n #[inline]\n fn next_back(&= mut self) -> Option<&'a A> {\n self.inner.next_back()\n }\n}\n\n#= [stable(feature =3D \"rust1\", since =3D \"1.0.0\")]\nimpl ExactSizeIter= ator for Iter<'_, A> {}\n\n#[stable(feature =3D \"fused\", since =3D \"1.26= .0\")]\nimpl FusedIterator for Iter<'_, A> {}\n\n#[unstable(feature =3D = \"trusted_len\", issue =3D \"37572\")]\nunsafe impl TrustedLen for Iter<= '_, A> {}\n\n#[stable(feature =3D \"rust1\", since =3D \"1.0.0\")]\nimpl= Clone for Iter<'_, A> {\n #[inline]\n fn clone(&self) -> Self {\n = Iter { inner: self.inner.clone() }\n }\n}\n\n/// An iterator over a= mutable reference to the [`Some`] variant of an [`Option`].\n///\n/// The = iterator yields one value if the [`Option`] is a [`Some`], otherwise none.\= n///\n/// This `struct` is created by the [`Option::iter_mut`] function.\n#= [stable(feature =3D \"rust1\", since =3D \"1.0.0\")]\n#[derive(Debug)]\npub= struct IterMut<'a, A: 'a> {\n inner: Item<&'a mut A>,\n}\n\n#[stable(fe= ature =3D \"rust1\", since =3D \"1.0.0\")]\nimpl<'a, A> Iterator for IterMu= t<'a, A> {\n type Item =3D &'a mut A;\n\n #[inline]\n fn next(&mut= self) -> Option<&'a mut A> {\n self.inner.next()\n }\n #[inli= ne]\n fn size_hint(&self) -> (usize, Option) {\n self.inne= r.size_hint()\n }\n}\n\n#[stable(feature =3D \"rust1\", since =3D \"1.0.= 0\")]\nimpl<'a, A> DoubleEndedIterator for IterMut<'a, A> {\n #[inline]\= n fn next_back(&mut self) -> Option<&'a mut A> {\n self.inner.nex= t_back()\n }\n}\n\n#[stable(feature =3D \"rust1\", since =3D \"1.0.0\")]= \nimpl ExactSizeIterator for IterMut<'_, A> {}\n\n#[stable(feature =3D \= "fused\", since =3D \"1.26.0\")]\nimpl FusedIterator for IterMut<'_, A> = {}\n#[unstable(feature =3D \"trusted_len\", issue =3D \"37572\")]\nunsafe i= mpl TrustedLen for IterMut<'_, A> {}\n\n/// An iterator over the value i= n [`Some`] variant of an [`Option`].\n///\n/// The iterator yields one valu= e if the [`Option`] is a [`Some`], otherwise none.\n///\n/// This `struct` = is created by the [`Option::into_iter`] function.\n#[derive(Clone, Debug)]\= n#[stable(feature =3D \"rust1\", since =3D \"1.0.0\")]\npub struct IntoIter= {\n inner: Item,\n}\n\n#[stable(feature =3D \"rust1\", since =3D = \"1.0.0\")]\nimpl Iterator for IntoIter {\n type Item =3D A;\n\n = #[inline]\n fn next(&mut self) -> Option {\n self.inner.next= ()\n }\n #[inline]\n fn size_hint(&self) -> (usize, Option)= {\n self.inner.size_hint()\n }\n}\n\n#[stable(feature =3D \"rust= 1\", since =3D \"1.0.0\")]\nimpl DoubleEndedIterator for IntoIter {\n= #[inline]\n fn next_back(&mut self) -> Option {\n self.inn= er.next_back()\n }\n}\n\n#[stable(feature =3D \"rust1\", since =3D \"1.0= .0\")]\nimpl ExactSizeIterator for IntoIter {}\n\n#[stable(feature = =3D \"fused\", since =3D \"1.26.0\")]\nimpl FusedIterator for IntoIter {}\n\n#[unstable(feature =3D \"trusted_len\", issue =3D \"37572\")]\nunsa= fe impl TrustedLen for IntoIter {}\n\n///////////////////////////////= //////////////////////////////////////////////\n// FromIterator\n//////////= ///////////////////////////////////////////////////////////////////\n\n#[st= able(feature =3D \"rust1\", since =3D \"1.0.0\")]\nimpl> FromIterator> for Option {\n /// Takes each element in = the [`Iterator`]: if it is [`None`][Option::None],\n /// no further elem= ents are taken, and the [`None`][Option::None] is\n /// returned. Should= no [`None`][Option::None] occur, a container of type\n /// `V` containi= ng the values of each [`Option`] is returned.\n ///\n /// # Examples\= n ///\n /// Here is an example which increments every integer in a ve= ctor.\n /// We use the checked variant of `add` that returns `None` when= the\n /// calculation would result in an overflow.\n ///\n /// ``= `\n /// let items =3D vec![0_u16, 1, 2];\n ///\n /// let res: Opti= on> =3D items\n /// .iter()\n /// .map(|x| x.checked= _add(1))\n /// .collect();\n ///\n /// assert_eq!(res, Some(ve= c![1, 2, 3]));\n /// ```\n ///\n /// As you can see, this will ret= urn the expected, valid items.\n ///\n /// Here is another example th= at tries to subtract one from another list\n /// of integers, this time = checking for underflow:\n ///\n /// ```\n /// let items =3D vec![2= _u16, 1, 0];\n ///\n /// let res: Option> =3D items\n ///= .iter()\n /// .map(|x| x.checked_sub(1))\n /// .collect(= );\n ///\n /// assert_eq!(res, None);\n /// ```\n ///\n /// = Since the last element is zero, it would underflow. Thus, the resulting\n = /// value is `None`.\n ///\n /// Here is a variation on the previou= s example, showing that no\n /// further elements are taken from `iter` = after the first `None`.\n ///\n /// ```\n /// let items =3D vec![3= _u16, 2, 1, 10];\n ///\n /// let mut shared =3D 0;\n ///\n /// = let res: Option> =3D items\n /// .iter()\n /// .map(= |x| { shared +=3D x; x.checked_sub(2) })\n /// .collect();\n ///\= n /// assert_eq!(res, None);\n /// assert_eq!(shared, 6);\n /// ``= `\n ///\n /// Since the third element caused an underflow, no further= elements were taken,\n /// so the final value of `shared` is 6 (=3D `3 = + 2 + 1`), not 16.\n #[inline]\n fn from_iter>>(iter: I) -> Option {\n // FIXME(#11084): This cou= ld be replaced with Iterator::scan when this\n // performance bug is= closed.\n\n iter::try_process(iter.into_iter(), |i| i.collect())\n = }\n}\n\n#[unstable(feature =3D \"try_trait_v2\", issue =3D \"84277\")]\n= #[rustc_const_unstable(feature =3D \"const_convert\", issue =3D \"88674\")]= \nimpl const ops::Try for Option {\n type Output =3D T;\n type = Residual =3D Option;\n\n #[inline]\n fn from_out= put(output: Self::Output) -> Self {\n Some(output)\n }\n\n #[i= nline]\n fn branch(self) -> ControlFlow {\= n match self {\n Some(v) =3D> ControlFlow::Continue(v),\n= None =3D> ControlFlow::Break(None),\n }\n }\n}\n\n#[u= nstable(feature =3D \"try_trait_v2\", issue =3D \"84277\")]\n#[rustc_const_= unstable(feature =3D \"const_convert\", issue =3D \"88674\")]\nimpl cons= t ops::FromResidual for Option {\n #[inline]\n fn from_residual(re= sidual: Option) -> Self {\n match residual {\n = None =3D> None,\n }\n }\n}\n\n#[unstable(feature =3D \= "try_trait_v2_yeet\", issue =3D \"96374\")]\nimpl ops::FromResidual> for Option {\n #[inline]\n fn from_residual(ops::Yeet((= )): ops::Yeet<()>) -> Self {\n None\n }\n}\n\n#[unstable(feature = =3D \"try_trait_v2_residual\", issue =3D \"91285\")]\nimpl ops::Residual= for Option {\n type TryType =3D Option;\n}\n= \nimpl Option> {\n /// Converts from `Option>` to= `Option`.\n ///\n /// # Examples\n ///\n /// Basic usage:\n= ///\n /// ```\n /// let x: Option> =3D Some(Some(6));= \n /// assert_eq!(Some(6), x.flatten());\n ///\n /// let x: Option= > =3D Some(None);\n /// assert_eq!(None, x.flatten());\n = ///\n /// let x: Option> =3D None;\n /// assert_eq!(None,= x.flatten());\n /// ```\n ///\n /// Flattening only removes one l= evel of nesting at a time:\n ///\n /// ```\n /// let x: Option>> =3D Some(Some(Some(6)));\n /// assert_eq!(Some(Some(6)= ), x.flatten());\n /// assert_eq!(Some(6), x.flatten().flatten());\n = /// ```\n #[inline]\n #[stable(feature =3D \"option_flattening\", sin= ce =3D \"1.40.0\")]\n #[rustc_const_unstable(feature =3D \"const_option\= ", issue =3D \"67441\")]\n pub const fn flatten(self) -> Option {\n = match self {\n Some(inner) =3D> inner,\n None = =3D> None,\n }\n }\n}\n","uri":"file:///home/dick/.rustup/toolcha= ins/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/o= ption.rs","version":0} 17:00:16 INFO unnamed src/language_server_protocol.rs:1888 text_document_co= de_lens; params=3DObject({"bufnr": Number(2), "filename": String("/home/dic= k/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/l= ibrary/core/src/option.rs"), "languageId": String("rust"), "position": Obje= ct({"character": Number(0), "line": Number(0)}), "viewport": Object({"end":= Number(22), "start": Number(0)})}) 17:00:16 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:command","params":["setlocal omnifunc=3DLanguageClient#complete= "]} 17:00:16 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"setbufvar","params":["/home/dick/.rustup/toolchains/stable-x86_64= -unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs","Langua= geClient_projectRoot","/home/dick/LanguageClient-neovim"]} 17:00:16 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:ExecuteAutocmd","params":["LanguageClientTextDocumentDidOpenPos= t"]} 17:00:16 DEBUG writer-Some("rust") src/rpcclient.rs:254 =3D> Some("rust") {= "jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"= languageId":"rust","text":"//! Optional values.\n//!\n//! Type [`Option`] r= epresents an optional value: every [`Option`]\n//! is either [`Some`] and c= ontains a value, or [`None`], and\n//! does not. [`Option`] types are very = common in Rust code, as\n//! they have a number of uses:\n//!\n//! * Initia= l values\n//! * Return values for functions that are not defined\n//! ove= r their entire input range (partial functions)\n//! * Return value for othe= rwise reporting simple errors, where [`None`] is\n//! returned on error\n= //! * Optional struct fields\n//! * Struct fields that can be loaned or \"t= aken\"\n//! * Optional function arguments\n//! * Nullable pointers\n//! * S= wapping things out of difficult situations\n//!\n//! [`Option`]s are common= ly paired with pattern matching to query the presence\n//! of a value and t= ake action, always accounting for the [`None`] case.\n//!\n//! ```\n//! fn = divide(numerator: f64, denominator: f64) -> Option {\n//! if denom= inator =3D=3D 0.0 {\n//! None\n//! } else {\n//! Some(n= umerator / denominator)\n//! }\n//! }\n//!\n//! // The return value of = the function is an option\n//! let result =3D divide(2.0, 3.0);\n//!\n//! /= / Pattern match to retrieve the value\n//! match result {\n//! // The d= ivision was valid\n//! Some(x) =3D> println!(\"Result: {x}\"),\n//! = // The division was invalid\n//! None =3D> println!(\"Cannot divide= by 0\"),\n//! }\n//! ```\n//!\n//\n// FIXME: Show how `Option` is used in = practice, with lots of methods\n//\n//! # Options and pointers (\"nullable\= " pointers)\n//!\n//! Rust's pointer types must always point to a valid loc= ation; there are\n//! no \"null\" references. Instead, Rust has *optional* = pointers, like\n//! the optional owned box, [Option]<[Box\\]>.\n//!\n//! [Box\\]: ../../std/boxed/struct.Box.html\n//!\n//! The fol= lowing example uses [`Option`] to create an optional box of\n//! [`i32`]. N= otice that in order to use the inner [`i32`] value, the\n//! `check_optiona= l` function first needs to use pattern matching to\n//! determine whether t= he box has a value (i.e., it is [`Some(...)`][`Some`]) or\n//! not ([`None`= ]).\n//!\n//! ```\n//! let optional =3D None;\n//! check_optional(optional)= ;\n//!\n//! let optional =3D Some(Box::new(9000));\n//! check_optional(opti= onal);\n//!\n//! fn check_optional(optional: Option>) {\n//! m= atch optional {\n//! Some(p) =3D> println!(\"has value {p}\"),\n//!= None =3D> println!(\"has no value\"),\n//! }\n//! }\n//! ```\n= //!\n//! # Representation\n//!\n//! Rust guarantees to optimize the followi= ng types `T` such that\n//! [`Option`] has the same size as `T`:\n//!\n/= /! * [`Box`]\n//! * `&U`\n//! * `&mut U`\n//! * `fn`, `extern \"C\" fn`[= ^extern_fn]\n//! * [`num::NonZero*`]\n//! * [`ptr::NonNull`]\n//! * `#[r= epr(transparent)]` struct around one of the types in this list.\n//!\n//! [= ^extern_fn]: this remains true for any other ABI: `extern \"abi\" fn` (_e.g= ._, `extern \"system\" fn`)\n//!\n//! [`Box`]: ../../std/boxed/struct.Bo= x.html\n//! [`num::NonZero*`]: crate::num\n//! [`ptr::NonNull`]: crate::= ptr::NonNull\n//!\n//! This is called the \"null pointer optimization\" or = NPO.\n//!\n//! It is further guaranteed that, for the cases above, one can\= n//! [`mem::transmute`] from all valid values of `T` to `Option` and\n//= ! from `Some::(_)` to `T` (but transmuting `None::` to `T`\n//! is un= defined behaviour).\n//!\n//! # Method overview\n//!\n//! In addition to wo= rking with pattern matching, [`Option`] provides a wide\n//! variety of dif= ferent methods.\n//!\n//! ## Querying the variant\n//!\n//! The [`is_some`]= and [`is_none`] methods return [`true`] if the [`Option`]\n//! is [`Some`]= or [`None`], respectively.\n//!\n//! [`is_none`]: Option::is_none\n//! [`i= s_some`]: Option::is_some\n//!\n//! ## Adapters for working with references= \n//!\n//! * [`as_ref`] converts from [&][][Option]\\ to [Option]<[&]T>\n//! * [`as_mut`] converts from [&mut] [Opt= ion]\\ to [Option]<[&mut] T>\n//! * [`as_deref`] con= verts from [&][][Option]\\ to\n//! [Option]<[&]T::[= Target]>\n//! * [`as_deref_mut`] converts from [&mut] [Option]= \\ to\n//! [Option]<[&mut] T::[Target]>\n//! * [`a= s_pin_ref`] converts from [Pin]<[&][][Option]\\> to\n//! = [Option]<[Pin]<[&]T>>\n//! * [`as_pin_mut`] converts from [Pin]<[&mut] [Option]\\> to\n//! [Option]<[Pin]<[&mut] = T>>\n//!\n//! [&]: reference \"shared reference\"\n//! [&mut]: refer= ence \"mutable reference\"\n//! [Target]: Deref::Target \"ops::Deref::Targe= t\"\n//! [`as_deref`]: Option::as_deref\n//! [`as_deref_mut`]: Option::as_d= eref_mut\n//! [`as_mut`]: Option::as_mut\n//! [`as_pin_mut`]: Option::as_pi= n_mut\n//! [`as_pin_ref`]: Option::as_pin_ref\n//! [`as_ref`]: Option::as_r= ef\n//!\n//! ## Extracting the contained value\n//!\n//! These methods extr= act the contained value in an [`Option`] when it\n//! is the [`Some`] va= riant. If the [`Option`] is [`None`]:\n//!\n//! * [`expect`] panics with a = provided custom message\n//! * [`unwrap`] panics with a generic message\n//= ! * [`unwrap_or`] returns the provided default value\n//! * [`unwrap_or_def= ault`] returns the default value of the type `T`\n//! (which must impleme= nt the [`Default`] trait)\n//! * [`unwrap_or_else`] returns the result of e= valuating the provided\n//! function\n//!\n//! [`expect`]: Option::expect= \n//! [`unwrap`]: Option::unwrap\n//! [`unwrap_or`]: Option::unwrap_or\n//!= [`unwrap_or_default`]: Option::unwrap_or_default\n//! [`unwrap_or_else`]: = Option::unwrap_or_else\n//!\n//! ## Transforming contained values\n//!\n//!= These methods transform [`Option`] to [`Result`]:\n//!\n//! * [`ok_or`] tr= ansforms [`Some(v)`] to [`Ok(v)`], and [`None`] to\n//! [`Err(err)`] usin= g the provided default `err` value\n//! * [`ok_or_else`] transforms [`Some(= v)`] to [`Ok(v)`], and [`None`] to\n//! a value of [`Err`] using the prov= ided function\n//! * [`transpose`] transposes an [`Option`] of a [`Result`]= into a\n//! [`Result`] of an [`Option`]\n//!\n//! [`Err(err)`]: Err\n//!= [`Ok(v)`]: Ok\n//! [`Some(v)`]: Some\n//! [`ok_or`]: Option::ok_or\n//! [`= ok_or_else`]: Option::ok_or_else\n//! [`transpose`]: Option::transpose\n//!= \n//! These methods transform the [`Some`] variant:\n//!\n//! * [`filter`] = calls the provided predicate function on the contained\n//! value `t` if = the [`Option`] is [`Some(t)`], and returns [`Some(t)`]\n//! if the functi= on returns `true`; otherwise, returns [`None`]\n//! * [`flatten`] removes o= ne level of nesting from an\n//! [`Option>`]\n//! * [`map`] tra= nsforms [`Option`] to [`Option`] by applying the\n//! provided func= tion to the contained value of [`Some`] and leaving\n//! [`None`] values = unchanged\n//!\n//! [`Some(t)`]: Some\n//! [`filter`]: Option::filter\n//! = [`flatten`]: Option::flatten\n//! [`map`]: Option::map\n//!\n//! These meth= ods transform [`Option`] to a value of a possibly\n//! different type `U= `:\n//!\n//! * [`map_or`] applies the provided function to the contained va= lue of\n//! [`Some`], or returns the provided default value if the [`Opti= on`] is\n//! [`None`]\n//! * [`map_or_else`] applies the provided functio= n to the contained value\n//! of [`Some`], or returns the result of evalu= ating the provided\n//! fallback function if the [`Option`] is [`None`]\n= //!\n//! [`map_or`]: Option::map_or\n//! [`map_or_else`]: Option::map_or_el= se\n//!\n//! These methods combine the [`Some`] variants of two [`Option`] = values:\n//!\n//! * [`zip`] returns [`Some((s, o))`] if `self` is [`Some(s)= `] and the\n//! provided [`Option`] value is [`Some(o)`]; otherwise, retu= rns [`None`]\n//! * [`zip_with`] calls the provided function `f` and return= s\n//! [`Some(f(s, o))`] if `self` is [`Some(s)`] and the provided\n//! = [`Option`] value is [`Some(o)`]; otherwise, returns [`None`]\n//!\n//! [`S= ome(f(s, o))`]: Some\n//! [`Some(o)`]: Some\n//! [`Some(s)`]: Some\n//! [`S= ome((s, o))`]: Some\n//! [`zip`]: Option::zip\n//! [`zip_with`]: Option::zi= p_with\n//!\n//! ## Boolean operators\n//!\n//! These methods treat the [`O= ption`] as a boolean value, where [`Some`]\n//! acts like [`true`] and [`No= ne`] acts like [`false`]. There are two\n//! categories of these methods: o= nes that take an [`Option`] as input, and\n//! ones that take a function as= input (to be lazily evaluated).\n//!\n//! The [`and`], [`or`], and [`xor`]= methods take another [`Option`] as\n//! input, and produce an [`Option`] a= s output. Only the [`and`] method can\n//! produce an [`Option`] value h= aving a different inner type `U` than\n//! [`Option`].\n//!\n//! | metho= d | self | input | output |\n//! |---------|-----------|------= -----|-----------|\n//! | [`and`] | `None` | (ignored) | `None` |\n//= ! | [`and`] | `Some(x)` | `None` | `None` |\n//! | [`and`] | `Some(x)= ` | `Some(y)` | `Some(y)` |\n//! | [`or`] | `None` | `None` | `None`= |\n//! | [`or`] | `None` | `Some(y)` | `Some(y)` |\n//! | [`or`] |= `Some(x)` | (ignored) | `Some(x)` |\n//! | [`xor`] | `None` | `None` = | `None` |\n//! | [`xor`] | `None` | `Some(y)` | `Some(y)` |\n//! | = [`xor`] | `Some(x)` | `None` | `Some(x)` |\n//! | [`xor`] | `Some(x)` | = `Some(y)` | `None` |\n//!\n//! [`and`]: Option::and\n//! [`or`]: Option:= :or\n//! [`xor`]: Option::xor\n//!\n//! The [`and_then`] and [`or_else`] me= thods take a function as input, and\n//! only evaluate the function when th= ey need to produce a new value. Only\n//! the [`and_then`] method can produ= ce an [`Option`] value having a\n//! different inner type `U` than [`Opt= ion`].\n//!\n//! | method | self | function input | function = result | output |\n//! |--------------|-----------|----------------|----= -------------|-----------|\n//! | [`and_then`] | `None` | (not provided)= | (not evaluated) | `None` |\n//! | [`and_then`] | `Some(x)` | `x` = | `None` | `None` |\n//! | [`and_then`] | `Some(x)` | `x= ` | `Some(y)` | `Some(y)` |\n//! | [`or_else`] | `None` = | (not provided) | `None` | `None` |\n//! | [`or_else`] | `N= one` | (not provided) | `Some(y)` | `Some(y)` |\n//! | [`or_else`]= | `Some(x)` | (not provided) | (not evaluated) | `Some(x)` |\n//!\n//! [`= and_then`]: Option::and_then\n//! [`or_else`]: Option::or_else\n//!\n//! Th= is is an example of using methods like [`and_then`] and [`or`] in a\n//! pi= peline of method calls. Early stages of the pipeline pass failure\n//! valu= es ([`None`]) through unchanged, and continue processing on\n//! success va= lues ([`Some`]). Toward the end, [`or`] substitutes an error\n//! message i= f it receives [`None`].\n//!\n//! ```\n//! # use std::collections::BTreeMap= ;\n//! let mut bt =3D BTreeMap::new();\n//! bt.insert(20u8, \"foo\");\n//! = bt.insert(42u8, \"bar\");\n//! let res =3D [0u8, 1, 11, 200, 22]\n//! .= into_iter()\n//! .map(|x| {\n//! // `checked_sub()` returns `No= ne` on error\n//! x.checked_sub(1)\n//! // same with `c= hecked_mul()`\n//! .and_then(|x| x.checked_mul(2))\n//! = // `BTreeMap::get` returns `None` on error\n//! .and_then(= |x| bt.get(&x))\n//! // Substitute an error message if we have = `None` so far\n//! .or(Some(&\"error!\"))\n//! .cop= ied()\n//! // Won't panic because we unconditionally used `Some= ` above\n//! .unwrap()\n//! })\n//! .collect::>(= );\n//! assert_eq!(res, [\"error!\", \"error!\", \"foo\", \"error!\", \"bar= \"]);\n//! ```\n//!\n//! ## Comparison operators\n//!\n//! If `T` implement= s [`PartialOrd`] then [`Option`] will derive its\n//! [`PartialOrd`] imp= lementation. With this order, [`None`] compares as\n//! less than any [`So= me`], and two [`Some`] compare the same way as their\n//! contained values = would in `T`. If `T` also implements\n//! [`Ord`], then so does [`Option`].\n//!\n//! ```\n//! assert!(None < Some(0));\n//! assert!(Some(0) < Som= e(1));\n//! ```\n//!\n//! ## Iterating over `Option`\n//!\n//! An [`Option`= ] can be iterated over. This can be helpful if you need an\n//! iterator th= at is conditionally empty. The iterator will either produce\n//! a single v= alue (when the [`Option`] is [`Some`]), or produce no values\n//! (when the= [`Option`] is [`None`]). For example, [`into_iter`] acts like\n//! [`once(= v)`] if the [`Option`] is [`Some(v)`], and like [`empty()`] if\n//! the [`O= ption`] is [`None`].\n//!\n//! [`Some(v)`]: Some\n//! [`empty()`]: crate::i= ter::empty\n//! [`once(v)`]: crate::iter::once\n//!\n//! Iterators over [`O= ption`] come in three types:\n//!\n//! * [`into_iter`] consumes the [`Op= tion`] and produces the contained\n//! value\n//! * [`iter`] produces an = immutable reference of type `&T` to the\n//! contained value\n//! * [`ite= r_mut`] produces a mutable reference of type `&mut T` to the\n//! contain= ed value\n//!\n//! [`into_iter`]: Option::into_iter\n//! [`iter`]: Option::= iter\n//! [`iter_mut`]: Option::iter_mut\n//!\n//! An iterator over [`Optio= n`] can be useful when chaining iterators, for\n//! example, to conditional= ly insert items. (It's not always necessary to\n//! explicitly call an iter= ator constructor: many [`Iterator`] methods that\n//! accept other iterator= s will also accept iterable types that implement\n//! [`IntoIterator`], whi= ch includes [`Option`].)\n//!\n//! ```\n//! let yep =3D Some(42);\n//! let = nope =3D None;\n//! // chain() already calls into_iter(), so we don't have = to do so\n//! let nums: Vec =3D (0..4).chain(yep).chain(4..8).collect(= );\n//! assert_eq!(nums, [0, 1, 2, 3, 42, 4, 5, 6, 7]);\n//! let nums: Vec<= i32> =3D (0..4).chain(nope).chain(4..8).collect();\n//! assert_eq!(nums, [0= , 1, 2, 3, 4, 5, 6, 7]);\n//! ```\n//!\n//! One reason to chain iterators i= n this way is that a function returning\n//! `impl Iterator` must have all = possible return values be of the same\n//! concrete type. Chaining an itera= ted [`Option`] can help with that.\n//!\n//! ```\n//! fn make_iter(do_inser= t: bool) -> impl Iterator {\n//! // Explicit returns to i= llustrate return types matching\n//! match do_insert {\n//! tru= e =3D> return (0..4).chain(Some(42)).chain(4..8),\n//! false =3D> r= eturn (0..4).chain(None).chain(4..8),\n//! }\n//! }\n//! println!(\"{:?= }\", make_iter(true).collect::>());\n//! println!(\"{:?}\", make_ite= r(false).collect::>());\n//! ```\n//!\n//! If we try to do the same = thing, but using [`once()`] and [`empty()`],\n//! we can't return `impl Ite= rator` anymore because the concrete types of\n//! the return values differ.= \n//!\n//! [`empty()`]: crate::iter::empty\n//! [`once()`]: crate::iter::on= ce\n//!\n//! ```compile_fail,E0308\n//! # use std::iter::{empty, once};\n//= ! // This won't compile because all possible returns from the function\n//!= // must have the same concrete type.\n//! fn make_iter(do_insert: bool) ->= impl Iterator {\n//! // Explicit returns to illustrate r= eturn types not matching\n//! match do_insert {\n//! true =3D> = return (0..4).chain(once(42)).chain(4..8),\n//! false =3D> return (= 0..4).chain(empty()).chain(4..8),\n//! }\n//! }\n//! ```\n//!\n//! ## C= ollecting into `Option`\n//!\n//! [`Option`] implements the [`FromIterator`= ][impl-FromIterator] trait,\n//! which allows an iterator over [`Option`] v= alues to be collected into an\n//! [`Option`] of a collection of each conta= ined value of the original\n//! [`Option`] values, or [`None`] if any of th= e elements was [`None`].\n//!\n//! [impl-FromIterator]: Option#impl-FromIte= rator%3COption%3CA%3E%3E\n//!\n//! ```\n//! let v =3D [Some(2), Some(4), No= ne, Some(8)];\n//! let res: Option> =3D v.into_iter().collect();\n//= ! assert_eq!(res, None);\n//! let v =3D [Some(2), Some(4), Some(8)];\n//! l= et res: Option> =3D v.into_iter().collect();\n//! assert_eq!(res, So= me(vec![2, 4, 8]));\n//! ```\n//!\n//! [`Option`] also implements the [`Pro= duct`][impl-Product] and\n//! [`Sum`][impl-Sum] traits, allowing an iterato= r over [`Option`] values\n//! to provide the [`product`][Iterator::product]= and\n//! [`sum`][Iterator::sum] methods.\n//!\n//! [impl-Product]: Option#= impl-Product%3COption%3CU%3E%3E\n//! [impl-Sum]: Option#impl-Sum%3COption%3= CU%3E%3E\n//!\n//! ```\n//! let v =3D [None, Some(1), Some(2), Some(3)];\n/= /! let res: Option =3D v.into_iter().sum();\n//! assert_eq!(res, None)= ;\n//! let v =3D [Some(1), Some(2), Some(21)];\n//! let res: Option = =3D v.into_iter().product();\n//! assert_eq!(res, Some(42));\n//! ```\n//!\= n//! ## Modifying an [`Option`] in-place\n//!\n//! These methods return a m= utable reference to the contained value of an\n//! [`Option`]:\n//!\n//!= * [`insert`] inserts a value, dropping any old contents\n//! * [`get_or_in= sert`] gets the current value, inserting a provided\n//! default value if= it is [`None`]\n//! * [`get_or_insert_default`] gets the current value, in= serting the\n//! default value of type `T` (which must implement [`Defaul= t`]) if it is\n//! [`None`]\n//! * [`get_or_insert_with`] gets the curren= t value, inserting a default\n//! computed by the provided function if it= is [`None`]\n//!\n//! [`get_or_insert`]: Option::get_or_insert\n//! [`get_= or_insert_default`]: Option::get_or_insert_default\n//! [`get_or_insert_wit= h`]: Option::get_or_insert_with\n//! [`insert`]: Option::insert\n//!\n//! T= hese methods transfer ownership of the contained value of an\n//! [`Option`= ]:\n//!\n//! * [`take`] takes ownership of the contained value of an [`Opti= on`], if\n//! any, replacing the [`Option`] with [`None`]\n//! * [`replac= e`] takes ownership of the contained value of an [`Option`],\n//! if any,= replacing the [`Option`] with a [`Some`] containing the\n//! provided va= lue\n//!\n//! [`replace`]: Option::replace\n//! [`take`]: Option::take\n//!= \n//! # Examples\n//!\n//! Basic pattern matching on [`Option`]:\n//!\n//! = ```\n//! let msg =3D Some(\"howdy\");\n//!\n//! // Take a reference to the = contained string\n//! if let Some(m) =3D &msg {\n//! println!(\"{}\", *= m);\n//! }\n//!\n//! // Remove the contained string, destroying the Option\= n//! let unwrapped_msg =3D msg.unwrap_or(\"default message\");\n//! ```\n//= !\n//! Initialize a result to [`None`] before a loop:\n//!\n//! ```\n//! en= um Kingdom { Plant(u32, &'static str), Animal(u32, &'static str) }\n//!\n//= ! // A list of data to search through.\n//! let all_the_big_things =3D [\n/= /! Kingdom::Plant(250, \"redwood\"),\n//! Kingdom::Plant(230, \"nob= le fir\"),\n//! Kingdom::Plant(229, \"sugar pine\"),\n//! Kingdom::= Animal(25, \"blue whale\"),\n//! Kingdom::Animal(19, \"fin whale\"),\n/= /! Kingdom::Animal(15, \"north pacific right whale\"),\n//! ];\n//!\n//= ! // We're going to search for the name of the biggest animal,\n//! // but = to start with we've just got `None`.\n//! let mut name_of_biggest_animal = =3D None;\n//! let mut size_of_biggest_animal =3D 0;\n//! for big_thing in = &all_the_big_things {\n//! match *big_thing {\n//! Kingdom::Ani= mal(size, name) if size > size_of_biggest_animal =3D> {\n//! //= Now we've found the name of some big animal\n//! size_of_bigge= st_animal =3D size;\n//! name_of_biggest_animal =3D Some(name);= \n//! }\n//! Kingdom::Animal(..) | Kingdom::Plant(..) =3D> = ()\n//! }\n//! }\n//!\n//! match name_of_biggest_animal {\n//! Some= (name) =3D> println!(\"the biggest animal is {name}\"),\n//! None =3D> = println!(\"there are no animals :(\"),\n//! }\n//! ```\n\n#![stable(feature= =3D \"rust1\", since =3D \"1.0.0\")]\n\nuse crate::iter::{self, FromIterat= or, FusedIterator, TrustedLen};\nuse crate::marker::Destruct;\nuse crate::p= anicking::{panic, panic_str};\nuse crate::pin::Pin;\nuse crate::{\n conv= ert, hint, mem,\n ops::{self, ControlFlow, Deref, DerefMut},\n};\n\n/// = The `Option` type. See [the module level documentation](self) for more.\n#[= derive(Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)]\n#[rustc_diagnos= tic_item =3D \"Option\"]\n#[stable(feature =3D \"rust1\", since =3D \"1.0.0= \")]\npub enum Option {\n /// No value.\n #[lang =3D \"None\"]\n = #[stable(feature =3D \"rust1\", since =3D \"1.0.0\")]\n None,\n ///= Some value of type `T`.\n #[lang =3D \"Some\"]\n #[stable(feature = =3D \"rust1\", since =3D \"1.0.0\")]\n Some(#[stable(feature =3D \"rust1= \", since =3D \"1.0.0\")] T),\n}\n\n///////////////////////////////////////= //////////////////////////////////////\n// Type implementation\n///////////= //////////////////////////////////////////////////////////////////\n\nimpl<= T> Option {\n ///////////////////////////////////////////////////////= //////////////////\n // Querying the contained values\n /////////////= ////////////////////////////////////////////////////////////\n\n /// Ret= urns `true` if the option is a [`Some`] value.\n ///\n /// # Examples= \n ///\n /// ```\n /// let x: Option =3D Some(2);\n /// as= sert_eq!(x.is_some(), true);\n ///\n /// let x: Option =3D None;= \n /// assert_eq!(x.is_some(), false);\n /// ```\n #[must_use =3D = \"if you intended to assert that this has a value, consider `.unwrap()` ins= tead\"]\n #[inline]\n #[stable(feature =3D \"rust1\", since =3D \"1.0= .0\")]\n #[rustc_const_stable(feature =3D \"const_option_basics\", since= =3D \"1.48.0\")]\n pub const fn is_some(&self) -> bool {\n match= es!(*self, Some(_))\n }\n\n /// Returns `true` if the option is a [`S= ome`] and the value inside of it matches a predicate.\n ///\n /// # E= xamples\n ///\n /// ```\n /// #![feature(is_some_with)]\n ///\n= /// let x: Option =3D Some(2);\n /// assert_eq!(x.is_some_and(|= &x| x > 1), true);\n ///\n /// let x: Option =3D Some(0);\n /= // assert_eq!(x.is_some_and(|&x| x > 1), false);\n ///\n /// let x: O= ption =3D None;\n /// assert_eq!(x.is_some_and(|&x| x > 1), false);= \n /// ```\n #[must_use]\n #[inline]\n #[unstable(feature =3D \= "is_some_with\", issue =3D \"93050\")]\n pub fn is_some_and(&self, f: im= pl FnOnce(&T) -> bool) -> bool {\n matches!(self, Some(x) if f(x))\n= }\n\n /// Returns `true` if the option is a [`None`] value.\n ///= \n /// # Examples\n ///\n /// ```\n /// let x: Option =3D = Some(2);\n /// assert_eq!(x.is_none(), false);\n ///\n /// let x: = Option =3D None;\n /// assert_eq!(x.is_none(), true);\n /// ```\= n #[must_use =3D \"if you intended to assert that this doesn't have a va= lue, consider \\\n `.and_then(|_| panic!(\\\"`Option` had = a value when expected `None`\\\"))` instead\"]\n #[inline]\n #[stable= (feature =3D \"rust1\", since =3D \"1.0.0\")]\n #[rustc_const_stable(fea= ture =3D \"const_option_basics\", since =3D \"1.48.0\")]\n pub const fn = is_none(&self) -> bool {\n !self.is_some()\n }\n\n ///////////= //////////////////////////////////////////////////////////////\n // Adap= ter for working with references\n //////////////////////////////////////= ///////////////////////////////////\n\n /// Converts from `&Option` t= o `Option<&T>`.\n ///\n /// # Examples\n ///\n /// Converts an = Option<[String]> into an Option<[usize]>, preserv= ing\n /// the original. The [`map`] method takes the `self` argument by = value, consuming the original,\n /// so this technique uses `as_ref` to = first take an `Option` to a reference\n /// to the value inside the orig= inal.\n ///\n /// [`map`]: Option::map\n /// [String]: ../../std/s= tring/struct.String.html \"String\"\n ///\n /// ```\n /// let text= : Option =3D Some(\"Hello, world!\".to_string());\n /// // First= , cast `Option` to `Option<&String>` with `as_ref`,\n /// // the= n consume *that* with `map`, leaving `text` on the stack.\n /// let text= _length: Option =3D text.as_ref().map(|s| s.len());\n /// println= !(\"still can print text: {text:?}\");\n /// ```\n #[inline]\n #[r= ustc_const_stable(feature =3D \"const_option_basics\", since =3D \"1.48.0\"= )]\n #[stable(feature =3D \"rust1\", since =3D \"1.0.0\")]\n pub cons= t fn as_ref(&self) -> Option<&T> {\n match *self {\n Some= (ref x) =3D> Some(x),\n None =3D> None,\n }\n }\n\n = /// Converts from `&mut Option` to `Option<&mut T>`.\n ///\n /// = # Examples\n ///\n /// ```\n /// let mut x =3D Some(2);\n /// m= atch x.as_mut() {\n /// Some(v) =3D> *v =3D 42,\n /// None = =3D> {},\n /// }\n /// assert_eq!(x, Some(42));\n /// ```\n #[i= nline]\n #[stable(feature =3D \"rust1\", since =3D \"1.0.0\")]\n #[ru= stc_const_unstable(feature =3D \"const_option\", issue =3D \"67441\")]\n = pub const fn as_mut(&mut self) -> Option<&mut T> {\n match *self {\= n Some(ref mut x) =3D> Some(x),\n None =3D> None,\n = }\n }\n\n /// Converts from [Pin]<[&]Option\\> = to Option<[Pin]<[&]T>>.\n ///\n /// [&]: reference \"sha= red reference\"\n #[inline]\n #[must_use]\n #[stable(feature =3D \= "pin\", since =3D \"1.33.0\")]\n #[rustc_const_unstable(feature =3D \"co= nst_option_ext\", issue =3D \"91930\")]\n pub const fn as_pin_ref(self: = Pin<&Self>) -> Option> {\n match Pin::get_ref(self).as_ref()= {\n // SAFETY: `x` is guaranteed to be pinned because it comes = from `self`\n // which is pinned.\n Some(x) =3D> unsa= fe { Some(Pin::new_unchecked(x)) },\n None =3D> None,\n }= \n }\n\n /// Converts from [Pin]<[&mut] Option\\> to = Option<[Pin]<[&mut] T>>.\n ///\n /// [&mut]: reference \= "mutable reference\"\n #[inline]\n #[must_use]\n #[stable(feature = =3D \"pin\", since =3D \"1.33.0\")]\n #[rustc_const_unstable(feature =3D= \"const_option_ext\", issue =3D \"91930\")]\n pub const fn as_pin_mut(s= elf: Pin<&mut Self>) -> Option> {\n // SAFETY: `get_unch= ecked_mut` is never used to move the `Option` inside `self`.\n // `x= ` is guaranteed to be pinned because it comes from `self` which is pinned.\= n unsafe {\n match Pin::get_unchecked_mut(self).as_mut() = {\n Some(x) =3D> Some(Pin::new_unchecked(x)),\n = None =3D> None,\n }\n }\n }\n\n ////////////////= /////////////////////////////////////////////////////////\n // Getting t= o contained values\n ///////////////////////////////////////////////////= //////////////////////\n\n /// Returns the contained [`Some`] value, con= suming the `self` value.\n ///\n /// # Panics\n ///\n /// Panic= s if the value is a [`None`] with a custom panic message provided by\n /= // `msg`.\n ///\n /// # Examples\n ///\n /// ```\n /// let x= =3D Some(\"value\");\n /// assert_eq!(x.expect(\"fruits are healthy\"),= \"value\");\n /// ```\n ///\n /// ```should_panic\n /// let x:= Option<&str> =3D None;\n /// x.expect(\"fruits are healthy\"); // panic= s with `fruits are healthy`\n /// ```\n ///\n /// # Recommended Me= ssage Style\n ///\n /// We recommend that `expect` messages are used = to describe the reason you\n /// _expect_ the `Option` should be `Some`.= \n ///\n /// ```should_panic\n /// # let slice: &[u8] =3D &[];\n = /// let item =3D slice.get(0)\n /// .expect(\"slice should not be = empty\");\n /// ```\n ///\n /// **Hint**: If you're having trouble= remembering how to phrase expect\n /// error messages remember to focus= on the word \"should\" as in \"env\n /// variable should be set by blah= \" or \"the given binary should be available\n /// and executable by the= current user\".\n ///\n /// For more detail on expect message styles= and the reasoning behind our\n /// recommendation please refer to the s= ection on [\"Common Message\n /// Styles\"](../../std/error/index.html#c= ommon-message-styles) in the [`std::error`](../../std/error/index.html) mod= ule docs.\n #[inline]\n #[track_caller]\n #[stable(feature =3D \"r= ust1\", since =3D \"1.0.0\")]\n #[rustc_const_unstable(feature =3D \"con= st_option\", issue =3D \"67441\")]\n pub const fn expect(self, msg: &str= ) -> T {\n match self {\n Some(val) =3D> val,\n = None =3D> expect_failed(msg),\n }\n }\n\n /// Returns the co= ntained [`Some`] value, consuming the `self` value.\n ///\n /// Becau= se this function may panic, its use is generally discouraged.\n /// Inst= ead, prefer to use pattern matching and handle the [`None`]\n /// case e= xplicitly, or call [`unwrap_or`], [`unwrap_or_else`], or\n /// [`unwrap_= or_default`].\n ///\n /// [`unwrap_or`]: Option::unwrap_or\n /// [= `unwrap_or_else`]: Option::unwrap_or_else\n /// [`unwrap_or_default`]: O= ption::unwrap_or_default\n ///\n /// # Panics\n ///\n /// Panic= s if the self value equals [`None`].\n ///\n /// # Examples\n ///\= n /// ```\n /// let x =3D Some(\"air\");\n /// assert_eq!(x.unwrap= (), \"air\");\n /// ```\n ///\n /// ```should_panic\n /// let x= : Option<&str> =3D None;\n /// assert_eq!(x.unwrap(), \"air\"); // fails= \n /// ```\n #[inline]\n #[track_caller]\n #[stable(feature =3D= \"rust1\", since =3D \"1.0.0\")]\n #[rustc_const_unstable(feature =3D \= "const_option\", issue =3D \"67441\")]\n pub const fn unwrap(self) -> T = {\n match self {\n Some(val) =3D> val,\n None = =3D> panic(\"called `Option::unwrap()` on a `None` value\"),\n }\n = }\n\n /// Returns the contained [`Some`] value or a provided default.\= n ///\n /// Arguments passed to `unwrap_or` are eagerly evaluated; if= you are passing\n /// the result of a function call, it is recommended = to use [`unwrap_or_else`],\n /// which is lazily evaluated.\n ///\n = /// [`unwrap_or_else`]: Option::unwrap_or_else\n ///\n /// # Exampl= es\n ///\n /// ```\n /// assert_eq!(Some(\"car\").unwrap_or(\"bike= \"), \"car\");\n /// assert_eq!(None.unwrap_or(\"bike\"), \"bike\");\n = /// ```\n #[inline]\n #[stable(feature =3D \"rust1\", since =3D \"1= .0.0\")]\n #[rustc_const_unstable(feature =3D \"const_option_ext\", issu= e =3D \"91930\")]\n pub const fn unwrap_or(self, default: T) -> T\n w= here\n T: ~const Destruct,\n {\n match self {\n = Some(x) =3D> x,\n None =3D> default,\n }\n }\n\n /= // Returns the contained [`Some`] value or computes it from a closure.\n = ///\n /// # Examples\n ///\n /// ```\n /// let k =3D 10;\n = /// assert_eq!(Some(4).unwrap_or_else(|| 2 * k), 4);\n /// assert_eq!(No= ne.unwrap_or_else(|| 2 * k), 20);\n /// ```\n #[inline]\n #[stable= (feature =3D \"rust1\", since =3D \"1.0.0\")]\n #[rustc_const_unstable(f= eature =3D \"const_option_ext\", issue =3D \"91930\")]\n pub const fn un= wrap_or_else(self, f: F) -> T\n where\n F: ~const FnOnce() -> = T,\n F: ~const Destruct,\n {\n match self {\n S= ome(x) =3D> x,\n None =3D> f(),\n }\n }\n\n /// Ret= urns the contained [`Some`] value or a default.\n ///\n /// Consumes = the `self` argument then, if [`Some`], returns the contained\n /// value= , otherwise if [`None`], returns the [default value] for that\n /// type= .\n ///\n /// # Examples\n ///\n /// Converts a string to an in= teger, turning poorly-formed strings\n /// into 0 (the default value for= integers). [`parse`] converts\n /// a string to any other type that imp= lements [`FromStr`], returning\n /// [`None`] on error.\n ///\n //= / ```\n /// let good_year_from_input =3D \"1909\";\n /// let bad_year= _from_input =3D \"190blarg\";\n /// let good_year =3D good_year_from_inp= ut.parse().ok().unwrap_or_default();\n /// let bad_year =3D bad_year_fro= m_input.parse().ok().unwrap_or_default();\n ///\n /// assert_eq!(1909= , good_year);\n /// assert_eq!(0, bad_year);\n /// ```\n ///\n = /// [default value]: Default::default\n /// [`parse`]: str::parse\n /= // [`FromStr`]: crate::str::FromStr\n #[inline]\n #[stable(feature = =3D \"rust1\", since =3D \"1.0.0\")]\n #[rustc_const_unstable(feature = =3D \"const_option_ext\", issue =3D \"91930\")]\n pub const fn unwrap_or= _default(self) -> T\n where\n T: ~const Default,\n {\n = match self {\n Some(x) =3D> x,\n None =3D> Default::d= efault(),\n }\n }\n\n /// Returns the contained [`Some`] value= , consuming the `self` value,\n /// without checking that the value is n= ot [`None`].\n ///\n /// # Safety\n ///\n /// Calling this meth= od on [`None`] is *[undefined behavior]*.\n ///\n /// [undefined beha= vior]: https://doc.rust-lang.org/reference/behavior-considered-undefined.ht= ml\n ///\n /// # Examples\n ///\n /// ```\n /// let x =3D So= me(\"air\");\n /// assert_eq!(unsafe { x.unwrap_unchecked() }, \"air\");= \n /// ```\n ///\n /// ```no_run\n /// let x: Option<&str> =3D = None;\n /// assert_eq!(unsafe { x.unwrap_unchecked() }, \"air\"); // Und= efined behavior!\n /// ```\n #[inline]\n #[track_caller]\n #[st= able(feature =3D \"option_result_unwrap_unchecked\", since =3D \"1.58.0\")]= \n #[rustc_const_unstable(feature =3D \"const_option_ext\", issue =3D \"= 91930\")]\n pub const unsafe fn unwrap_unchecked(self) -> T {\n d= ebug_assert!(self.is_some());\n match self {\n Some(val) = =3D> val,\n // SAFETY: the safety contract must be upheld by the= caller.\n None =3D> unsafe { hint::unreachable_unchecked() },\n= }\n }\n\n ///////////////////////////////////////////////////= //////////////////////\n // Transforming contained values\n /////////= ////////////////////////////////////////////////////////////////\n\n ///= Maps an `Option` to `Option` by applying a function to a contained v= alue.\n ///\n /// # Examples\n ///\n /// Converts an Opti= on<[String]> into an Option<[usize]>, consuming\n //= / the original:\n ///\n /// [String]: ../../std/string/struct.String.= html \"String\"\n /// ```\n /// let maybe_some_string =3D Some(String= ::from(\"Hello, World!\"));\n /// // `Option::map` takes self *by value*= , consuming `maybe_some_string`\n /// let maybe_some_len =3D maybe_some_= string.map(|s| s.len());\n ///\n /// assert_eq!(maybe_some_len, Some(= 13));\n /// ```\n #[inline]\n #[stable(feature =3D \"rust1\", sinc= e =3D \"1.0.0\")]\n #[rustc_const_unstable(feature =3D \"const_option_ex= t\", issue =3D \"91930\")]\n pub const fn map(self, f: F) -> Optio= n\n where\n F: ~const FnOnce(T) -> U,\n F: ~const Destr= uct,\n {\n match self {\n Some(x) =3D> Some(f(x)),\n = None =3D> None,\n }\n }\n\n /// Calls the provided c= losure with a reference to the contained value (if [`Some`]).\n ///\n = /// # Examples\n ///\n /// ```\n /// #![feature(result_option_ins= pect)]\n ///\n /// let v =3D vec![1, 2, 3, 4, 5];\n ///\n /// /= / prints \"got: 4\"\n /// let x: Option<&usize> =3D v.get(3).inspect(|x|= println!(\"got: {x}\"));\n ///\n /// // prints nothing\n /// let = x: Option<&usize> =3D v.get(5).inspect(|x| println!(\"got: {x}\"));\n //= / ```\n #[inline]\n #[unstable(feature =3D \"result_option_inspect\",= issue =3D \"91345\")]\n #[rustc_const_unstable(feature =3D \"const_opti= on_ext\", issue =3D \"91930\")]\n pub const fn inspect(self, f: F) ->= Self\n where\n F: ~const FnOnce(&T),\n F: ~const Destruct= ,\n {\n if let Some(ref x) =3D self {\n f(x);\n = }\n\n self\n }\n\n /// Returns the provided default result (i= f none),\n /// or applies a function to the contained value (if any).\n = ///\n /// Arguments passed to `map_or` are eagerly evaluated; if you = are passing\n /// the result of a function call, it is recommended to us= e [`map_or_else`],\n /// which is lazily evaluated.\n ///\n /// [`= map_or_else`]: Option::map_or_else\n ///\n /// # Examples\n ///\n = /// ```\n /// let x =3D Some(\"foo\");\n /// assert_eq!(x.map_or(4= 2, |v| v.len()), 3);\n ///\n /// let x: Option<&str> =3D None;\n /= // assert_eq!(x.map_or(42, |v| v.len()), 42);\n /// ```\n #[inline]\n= #[stable(feature =3D \"rust1\", since =3D \"1.0.0\")]\n #[rustc_cons= t_unstable(feature =3D \"const_option_ext\", issue =3D \"91930\")]\n pub= const fn map_or(self, default: U, f: F) -> U\n where\n F: = ~const FnOnce(T) -> U,\n F: ~const Destruct,\n U: ~const Dest= ruct,\n {\n match self {\n Some(t) =3D> f(t),\n = None =3D> default,\n }\n }\n\n /// Computes a default fun= ction result (if none), or\n /// applies a different function to the con= tained value (if any).\n ///\n /// # Examples\n ///\n /// ```\n= /// let k =3D 21;\n ///\n /// let x =3D Some(\"foo\");\n /// a= ssert_eq!(x.map_or_else(|| 2 * k, |v| v.len()), 3);\n ///\n /// let x= : Option<&str> =3D None;\n /// assert_eq!(x.map_or_else(|| 2 * k, |v| v.= len()), 42);\n /// ```\n #[inline]\n #[stable(feature =3D \"rust1\= ", since =3D \"1.0.0\")]\n #[rustc_const_unstable(feature =3D \"const_op= tion_ext\", issue =3D \"91930\")]\n pub const fn map_or_else(se= lf, default: D, f: F) -> U\n where\n D: ~const FnOnce() -> U,\n = D: ~const Destruct,\n F: ~const FnOnce(T) -> U,\n F: ~c= onst Destruct,\n {\n match self {\n Some(t) =3D> f(t),= \n None =3D> default(),\n }\n }\n\n /// Transforms = the `Option` into a [`Result`], mapping [`Some(v)`] to\n /// [`= Ok(v)`] and [`None`] to [`Err(err)`].\n ///\n /// Arguments passed to= `ok_or` are eagerly evaluated; if you are passing the\n /// result of a= function call, it is recommended to use [`ok_or_else`], which is\n /// = lazily evaluated.\n ///\n /// [`Ok(v)`]: Ok\n /// [`Err(err)`]: Er= r\n /// [`Some(v)`]: Some\n /// [`ok_or_else`]: Option::ok_or_else\n = ///\n /// # Examples\n ///\n /// ```\n /// let x =3D Some(\"= foo\");\n /// assert_eq!(x.ok_or(0), Ok(\"foo\"));\n ///\n /// let= x: Option<&str> =3D None;\n /// assert_eq!(x.ok_or(0), Err(0));\n //= / ```\n #[inline]\n #[stable(feature =3D \"rust1\", since =3D \"1.0.0= \")]\n #[rustc_const_unstable(feature =3D \"const_option_ext\", issue = =3D \"91930\")]\n pub const fn ok_or(self, err: E) -> Result\n = where\n E: ~const Destruct,\n {\n match self {\n = Some(v) =3D> Ok(v),\n None =3D> Err(err),\n }\n }= \n\n /// Transforms the `Option` into a [`Result`], mapping [`S= ome(v)`] to\n /// [`Ok(v)`] and [`None`] to [`Err(err())`].\n ///\n = /// [`Ok(v)`]: Ok\n /// [`Err(err())`]: Err\n /// [`Some(v)`]: Some= \n ///\n /// # Examples\n ///\n /// ```\n /// let x =3D Some= (\"foo\");\n /// assert_eq!(x.ok_or_else(|| 0), Ok(\"foo\"));\n ///\n= /// let x: Option<&str> =3D None;\n /// assert_eq!(x.ok_or_else(|| 0= ), Err(0));\n /// ```\n #[inline]\n #[stable(feature =3D \"rust1\"= , since =3D \"1.0.0\")]\n #[rustc_const_unstable(feature =3D \"const_opt= ion_ext\", issue =3D \"91930\")]\n pub const fn ok_or_else(self, e= rr: F) -> Result\n where\n F: ~const FnOnce() -> E,\n = F: ~const Destruct,\n {\n match self {\n Some(v) =3D= > Ok(v),\n None =3D> Err(err()),\n }\n }\n\n /// Co= nverts from `Option` (or `&Option`) to `Option<&T::Target>`.\n ///= \n /// Leaves the original Option in-place, creating a new one with a re= ference\n /// to the original one, additionally coercing the contents vi= a [`Deref`].\n ///\n /// # Examples\n ///\n /// ```\n /// le= t x: Option =3D Some(\"hey\".to_owned());\n /// assert_eq!(x.as_= deref(), Some(\"hey\"));\n ///\n /// let x: Option =3D None;\= n /// assert_eq!(x.as_deref(), None);\n /// ```\n #[stable(feature= =3D \"option_deref\", since =3D \"1.40.0\")]\n #[rustc_const_unstable(f= eature =3D \"const_option_ext\", issue =3D \"91930\")]\n pub const fn as= _deref(&self) -> Option<&T::Target>\n where\n T: ~const Deref,\n = {\n match self.as_ref() {\n Some(t) =3D> Some(t.deref(= )),\n None =3D> None,\n }\n }\n\n /// Converts from= `Option` (or `&mut Option`) to `Option<&mut T::Target>`.\n ///\n = /// Leaves the original `Option` in-place, creating a new one containing= a mutable reference to\n /// the inner type's [`Deref::Target`] type.\n= ///\n /// # Examples\n ///\n /// ```\n /// let mut x: Optio= n =3D Some(\"hey\".to_owned());\n /// assert_eq!(x.as_deref_mut(= ).map(|x| {\n /// x.make_ascii_uppercase();\n /// x\n /// = }), Some(\"HEY\".to_owned().as_mut_str()));\n /// ```\n #[stable(feat= ure =3D \"option_deref\", since =3D \"1.40.0\")]\n #[rustc_const_unstabl= e(feature =3D \"const_option_ext\", issue =3D \"91930\")]\n pub const fn= as_deref_mut(&mut self) -> Option<&mut T::Target>\n where\n T: ~= const DerefMut,\n {\n match self.as_mut() {\n Some(t) = =3D> Some(t.deref_mut()),\n None =3D> None,\n }\n }\n\= n //////////////////////////////////////////////////////////////////////= ///\n // Iterator constructors\n ////////////////////////////////////= /////////////////////////////////////\n\n /// Returns an iterator over t= he possibly contained value.\n ///\n /// # Examples\n ///\n ///= ```\n /// let x =3D Some(4);\n /// assert_eq!(x.iter().next(), Some(= &4));\n ///\n /// let x: Option =3D None;\n /// assert_eq!(x.= iter().next(), None);\n /// ```\n #[inline]\n #[rustc_const_unstab= le(feature =3D \"const_option\", issue =3D \"67441\")]\n #[stable(featur= e =3D \"rust1\", since =3D \"1.0.0\")]\n pub const fn iter(&self) -> Ite= r<'_, T> {\n Iter { inner: Item { opt: self.as_ref() } }\n }\n\n = /// Returns a mutable iterator over the possibly contained value.\n /= //\n /// # Examples\n ///\n /// ```\n /// let mut x =3D Some(4)= ;\n /// match x.iter_mut().next() {\n /// Some(v) =3D> *v =3D 42,= \n /// None =3D> {},\n /// }\n /// assert_eq!(x, Some(42));\n = ///\n /// let mut x: Option =3D None;\n /// assert_eq!(x.iter= _mut().next(), None);\n /// ```\n #[inline]\n #[stable(feature =3D= \"rust1\", since =3D \"1.0.0\")]\n pub fn iter_mut(&mut self) -> IterMu= t<'_, T> {\n IterMut { inner: Item { opt: self.as_mut() } }\n }\n= \n /////////////////////////////////////////////////////////////////////= ////\n // Boolean operations on the values, eager and lazy\n ////////= /////////////////////////////////////////////////////////////////\n\n //= / Returns [`None`] if the option is [`None`], otherwise returns `optb`.\n = ///\n /// # Examples\n ///\n /// ```\n /// let x =3D Some(2);= \n /// let y: Option<&str> =3D None;\n /// assert_eq!(x.and(y), None)= ;\n ///\n /// let x: Option =3D None;\n /// let y =3D Some(\"= foo\");\n /// assert_eq!(x.and(y), None);\n ///\n /// let x =3D So= me(2);\n /// let y =3D Some(\"foo\");\n /// assert_eq!(x.and(y), Some= (\"foo\"));\n ///\n /// let x: Option =3D None;\n /// let y: = Option<&str> =3D None;\n /// assert_eq!(x.and(y), None);\n /// ```\n = #[inline]\n #[stable(feature =3D \"rust1\", since =3D \"1.0.0\")]\n = #[rustc_const_unstable(feature =3D \"const_option_ext\", issue =3D \"9193= 0\")]\n pub const fn and(self, optb: Option) -> Option\n whe= re\n T: ~const Destruct,\n U: ~const Destruct,\n {\n = match self {\n Some(_) =3D> optb,\n None =3D> None,= \n }\n }\n\n /// Returns [`None`] if the option is [`None`], o= therwise calls `f` with the\n /// wrapped value and returns the result.\= n ///\n /// Some languages call this operation flatmap.\n ///\n = /// # Examples\n ///\n /// ```\n /// fn sq_then_to_string(x: u32)= -> Option {\n /// x.checked_mul(x).map(|sq| sq.to_string())= \n /// }\n ///\n /// assert_eq!(Some(2).and_then(sq_then_to_string= ), Some(4.to_string()));\n /// assert_eq!(Some(1_000_000).and_then(sq_th= en_to_string), None); // overflowed!\n /// assert_eq!(None.and_then(sq_t= hen_to_string), None);\n /// ```\n ///\n /// Often used to chain f= allible operations that may return [`None`].\n ///\n /// ```\n ///= let arr_2d =3D [[\"A0\", \"A1\"], [\"B0\", \"B1\"]];\n ///\n /// let= item_0_1 =3D arr_2d.get(0).and_then(|row| row.get(1));\n /// assert_eq!= (item_0_1, Some(&\"A1\"));\n ///\n /// let item_2_0 =3D arr_2d.get(2)= .and_then(|row| row.get(0));\n /// assert_eq!(item_2_0, None);\n /// = ```\n #[inline]\n #[stable(feature =3D \"rust1\", since =3D \"1.0.0\"= )]\n #[rustc_const_unstable(feature =3D \"const_option_ext\", issue =3D = \"91930\")]\n pub const fn and_then(self, f: F) -> Option\n = where\n F: ~const FnOnce(T) -> Option,\n F: ~const Destruc= t,\n {\n match self {\n Some(x) =3D> f(x),\n = None =3D> None,\n }\n }\n\n /// Returns [`None`] if the opti= on is [`None`], otherwise calls `predicate`\n /// with the wrapped value= and returns:\n ///\n /// - [`Some(t)`] if `predicate` returns `true`= (where `t` is the wrapped\n /// value), and\n /// - [`None`] if `p= redicate` returns `false`.\n ///\n /// This function works similar to= [`Iterator::filter()`]. You can imagine\n /// the `Option` being an = iterator over one or zero elements. `filter()`\n /// lets you decide whi= ch elements to keep.\n ///\n /// # Examples\n ///\n /// ```rust= \n /// fn is_even(n: &i32) -> bool {\n /// n % 2 =3D=3D 0\n //= / }\n ///\n /// assert_eq!(None.filter(is_even), None);\n /// asse= rt_eq!(Some(3).filter(is_even), None);\n /// assert_eq!(Some(4).filter(i= s_even), Some(4));\n /// ```\n ///\n /// [`Some(t)`]: Some\n #[= inline]\n #[stable(feature =3D \"option_filter\", since =3D \"1.27.0\")]= \n #[rustc_const_unstable(feature =3D \"const_option_ext\", issue =3D \"= 91930\")]\n pub const fn filter

(self, predicate: P) -> Self\n wher= e\n T: ~const Destruct,\n P: ~const FnOnce(&T) -> bool,\n = P: ~const Destruct,\n {\n if let Some(x) =3D self {\n = if predicate(&x) {\n return Some(x);\n }\n = }\n None\n }\n\n /// Returns the option if it contains a = value, otherwise returns `optb`.\n ///\n /// Arguments passed to `or`= are eagerly evaluated; if you are passing the\n /// result of a functio= n call, it is recommended to use [`or_else`], which is\n /// lazily eval= uated.\n ///\n /// [`or_else`]: Option::or_else\n ///\n /// # E= xamples\n ///\n /// ```\n /// let x =3D Some(2);\n /// let y = =3D None;\n /// assert_eq!(x.or(y), Some(2));\n ///\n /// let x = =3D None;\n /// let y =3D Some(100);\n /// assert_eq!(x.or(y), Some(1= 00));\n ///\n /// let x =3D Some(2);\n /// let y =3D Some(100);\n = /// assert_eq!(x.or(y), Some(2));\n ///\n /// let x: Option = =3D None;\n /// let y =3D None;\n /// assert_eq!(x.or(y), None);\n = /// ```\n #[inline]\n #[stable(feature =3D \"rust1\", since =3D \"1.= 0.0\")]\n #[rustc_const_unstable(feature =3D \"const_option_ext\", issue= =3D \"91930\")]\n pub const fn or(self, optb: Option) -> Option\n= where\n T: ~const Destruct,\n {\n match self {\n = Some(x) =3D> Some(x),\n None =3D> optb,\n }\n }\= n\n /// Returns the option if it contains a value, otherwise calls `f` a= nd\n /// returns the result.\n ///\n /// # Examples\n ///\n = /// ```\n /// fn nobody() -> Option<&'static str> { None }\n /// fn v= ikings() -> Option<&'static str> { Some(\"vikings\") }\n ///\n /// as= sert_eq!(Some(\"barbarians\").or_else(vikings), Some(\"barbarians\"));\n = /// assert_eq!(None.or_else(vikings), Some(\"vikings\"));\n /// assert_= eq!(None.or_else(nobody), None);\n /// ```\n #[inline]\n #[stable(= feature =3D \"rust1\", since =3D \"1.0.0\")]\n #[rustc_const_unstable(fe= ature =3D \"const_option_ext\", issue =3D \"91930\")]\n pub const fn or_= else(self, f: F) -> Option\n where\n F: ~const FnOnce() -> = Option,\n F: ~const Destruct,\n {\n match self {\n = Some(x) =3D> Some(x),\n None =3D> f(),\n }\n }\= n\n /// Returns [`Some`] if exactly one of `self`, `optb` is [`Some`], o= therwise returns [`None`].\n ///\n /// # Examples\n ///\n /// `= ``\n /// let x =3D Some(2);\n /// let y: Option =3D None;\n /= // assert_eq!(x.xor(y), Some(2));\n ///\n /// let x: Option =3D = None;\n /// let y =3D Some(2);\n /// assert_eq!(x.xor(y), Some(2));\n= ///\n /// let x =3D Some(2);\n /// let y =3D Some(2);\n /// as= sert_eq!(x.xor(y), None);\n ///\n /// let x: Option =3D None;\n = /// let y: Option =3D None;\n /// assert_eq!(x.xor(y), None);\n = /// ```\n #[inline]\n #[stable(feature =3D \"option_xor\", since = =3D \"1.37.0\")]\n #[rustc_const_unstable(feature =3D \"const_option_ext= \", issue =3D \"91930\")]\n pub const fn xor(self, optb: Option) -> O= ption\n where\n T: ~const Destruct,\n {\n match (sel= f, optb) {\n (Some(a), None) =3D> Some(a),\n (None, S= ome(b)) =3D> Some(b),\n _ =3D> None,\n }\n }\n\n //= ///////////////////////////////////////////////////////////////////////\n = // Entry-like operations to insert a value and return a reference\n //= ///////////////////////////////////////////////////////////////////////\n\n= /// Inserts `value` into the option, then returns a mutable reference t= o it.\n ///\n /// If the option already contains a value, the old val= ue is dropped.\n ///\n /// See also [`Option::get_or_insert`], which = doesn't update the value if\n /// the option already contains [`Some`].\= n ///\n /// # Example\n ///\n /// ```\n /// let mut opt =3D = None;\n /// let val =3D opt.insert(1);\n /// assert_eq!(*val, 1);\n = /// assert_eq!(opt.unwrap(), 1);\n /// let val =3D opt.insert(2);\n = /// assert_eq!(*val, 2);\n /// *val =3D 3;\n /// assert_eq!(opt.unwr= ap(), 3);\n /// ```\n #[must_use =3D \"if you intended to set a value= , consider assignment instead\"]\n #[inline]\n #[stable(feature =3D \= "option_insert\", since =3D \"1.53.0\")]\n #[rustc_const_unstable(featur= e =3D \"const_option_ext\", issue =3D \"91930\")]\n pub const fn insert(= &mut self, value: T) -> &mut T\n where\n T: ~const Destruct,\n = {\n *self =3D Some(value);\n\n // SAFETY: the code above jus= t filled the option\n unsafe { self.as_mut().unwrap_unchecked() }\n = }\n\n /// Inserts `value` into the option if it is [`None`], then\n = /// returns a mutable reference to the contained value.\n ///\n ///= See also [`Option::insert`], which updates the value even if\n /// the = option already contains [`Some`].\n ///\n /// # Examples\n ///\n = /// ```\n /// let mut x =3D None;\n ///\n /// {\n /// let= y: &mut u32 =3D x.get_or_insert(5);\n /// assert_eq!(y, &5);\n /= //\n /// *y =3D 7;\n /// }\n ///\n /// assert_eq!(x, Some(7= ));\n /// ```\n #[inline]\n #[stable(feature =3D \"option_entry\",= since =3D \"1.20.0\")]\n #[rustc_const_unstable(feature =3D \"const_opt= ion_ext\", issue =3D \"91930\")]\n pub const fn get_or_insert(&mut self,= value: T) -> &mut T\n where\n T: ~const Destruct,\n {\n = if let None =3D *self {\n *self =3D Some(value);\n }\n\= n // SAFETY: a `None` variant for `self` would have been replaced by= a `Some`\n // variant in the code above.\n unsafe { self.as_= mut().unwrap_unchecked() }\n }\n\n /// Inserts the default value into= the option if it is [`None`], then\n /// returns a mutable reference to= the contained value.\n ///\n /// # Examples\n ///\n /// ```\n = /// #![feature(option_get_or_insert_default)]\n ///\n /// let mut = x =3D None;\n ///\n /// {\n /// let y: &mut u32 =3D x.get_or_i= nsert_default();\n /// assert_eq!(y, &0);\n ///\n /// *y = =3D 7;\n /// }\n ///\n /// assert_eq!(x, Some(7));\n /// ```\n = #[inline]\n #[unstable(feature =3D \"option_get_or_insert_default\", = issue =3D \"82901\")]\n #[rustc_const_unstable(feature =3D \"const_optio= n_ext\", issue =3D \"91930\")]\n pub const fn get_or_insert_default(&mut= self) -> &mut T\n where\n T: ~const Default,\n {\n con= st fn default() -> T {\n T::default()\n = }\n\n self.get_or_insert_with(default)\n }\n\n /// Inserts a= value computed from `f` into the option if it is [`None`],\n /// then r= eturns a mutable reference to the contained value.\n ///\n /// # Exam= ples\n ///\n /// ```\n /// let mut x =3D None;\n ///\n /// {= \n /// let y: &mut u32 =3D x.get_or_insert_with(|| 5);\n /// = assert_eq!(y, &5);\n ///\n /// *y =3D 7;\n /// }\n ///\n = /// assert_eq!(x, Some(7));\n /// ```\n #[inline]\n #[stable(feat= ure =3D \"option_entry\", since =3D \"1.20.0\")]\n #[rustc_const_unstabl= e(feature =3D \"const_option_ext\", issue =3D \"91930\")]\n pub const fn= get_or_insert_with(&mut self, f: F) -> &mut T\n where\n F: ~c= onst FnOnce() -> T,\n F: ~const Destruct,\n {\n if let Non= e =3D *self {\n // the compiler isn't smart enough to know that = we are not dropping a `T`\n // here and wants us to ensure `T` c= an be dropped at compile time.\n mem::forget(mem::replace(self, = Some(f())))\n }\n\n // SAFETY: a `None` variant for `self` wo= uld have been replaced by a `Some`\n // variant in the code above.\n= unsafe { self.as_mut().unwrap_unchecked() }\n }\n\n /////////= ////////////////////////////////////////////////////////////////\n // Mi= sc\n ///////////////////////////////////////////////////////////////////= //////\n\n /// Takes the value out of the option, leaving a [`None`] in = its place.\n ///\n /// # Examples\n ///\n /// ```\n /// let = mut x =3D Some(2);\n /// let y =3D x.take();\n /// assert_eq!(x, None= );\n /// assert_eq!(y, Some(2));\n ///\n /// let mut x: Option =3D None;\n /// let y =3D x.take();\n /// assert_eq!(x, None);\n = /// assert_eq!(y, None);\n /// ```\n #[inline]\n #[stable(feature= =3D \"rust1\", since =3D \"1.0.0\")]\n #[rustc_const_unstable(feature = =3D \"const_option\", issue =3D \"67441\")]\n pub const fn take(&mut sel= f) -> Option {\n // FIXME replace `mem::replace` by `mem::take` w= hen the latter is const ready\n mem::replace(self, None)\n }\n\n = /// Replaces the actual value in the option by the value given in parame= ter,\n /// returning the old value if present,\n /// leaving a [`Some= `] in its place without deinitializing either one.\n ///\n /// # Exam= ples\n ///\n /// ```\n /// let mut x =3D Some(2);\n /// let old= =3D x.replace(5);\n /// assert_eq!(x, Some(5));\n /// assert_eq!(old= , Some(2));\n ///\n /// let mut x =3D None;\n /// let old =3D x.re= place(3);\n /// assert_eq!(x, Some(3));\n /// assert_eq!(old, None);\= n /// ```\n #[inline]\n #[rustc_const_unstable(feature =3D \"const= _option\", issue =3D \"67441\")]\n #[stable(feature =3D \"option_replace= \", since =3D \"1.31.0\")]\n pub const fn replace(&mut self, value: T) -= > Option {\n mem::replace(self, Some(value))\n }\n\n /// Re= turns `true` if the option is a [`Some`] value containing the given value.\= n ///\n /// # Examples\n ///\n /// ```\n /// #![feature(opti= on_result_contains)]\n ///\n /// let x: Option =3D Some(2);\n = /// assert_eq!(x.contains(&2), true);\n ///\n /// let x: Option= =3D Some(3);\n /// assert_eq!(x.contains(&2), false);\n ///\n ///= let x: Option =3D None;\n /// assert_eq!(x.contains(&2), false);\n= /// ```\n #[must_use]\n #[inline]\n #[unstable(feature =3D \"o= ption_result_contains\", issue =3D \"62358\")]\n #[rustc_const_unstable(= feature =3D \"const_option_ext\", issue =3D \"91930\")]\n pub const fn c= ontains(&self, x: &U) -> bool\n where\n U: ~const PartialEq= ,\n {\n match self {\n Some(y) =3D> x.eq(y),\n = None =3D> false,\n }\n }\n\n /// Zips `self` with another = `Option`.\n ///\n /// If `self` is `Some(s)` and `other` is `Some(o)`= , this method returns `Some((s, o))`.\n /// Otherwise, `None` is returne= d.\n ///\n /// # Examples\n ///\n /// ```\n /// let x =3D So= me(1);\n /// let y =3D Some(\"hi\");\n /// let z =3D None::;\n = ///\n /// assert_eq!(x.zip(y), Some((1, \"hi\")));\n /// assert_eq!(= x.zip(z), None);\n /// ```\n #[stable(feature =3D \"option_zip_option= \", since =3D \"1.46.0\")]\n #[rustc_const_unstable(feature =3D \"const_= option_ext\", issue =3D \"91930\")]\n pub const fn zip(self, other: O= ption) -> Option<(T, U)>\n where\n T: ~const Destruct,\n = U: ~const Destruct,\n {\n match (self, other) {\n (S= ome(a), Some(b)) =3D> Some((a, b)),\n _ =3D> None,\n }\n = }\n\n /// Zips `self` and another `Option` with function `f`.\n //= /\n /// If `self` is `Some(s)` and `other` is `Some(o)`, this method ret= urns `Some(f(s, o))`.\n /// Otherwise, `None` is returned.\n ///\n = /// # Examples\n ///\n /// ```\n /// #![feature(option_zip)]\n = ///\n /// #[derive(Debug, PartialEq)]\n /// struct Point {\n /// = x: f64,\n /// y: f64,\n /// }\n ///\n /// impl Point {\= n /// fn new(x: f64, y: f64) -> Self {\n /// Self { x, y = }\n /// }\n /// }\n ///\n /// let x =3D Some(17.5);\n //= / let y =3D Some(42.7);\n ///\n /// assert_eq!(x.zip_with(y, Point::n= ew), Some(Point { x: 17.5, y: 42.7 }));\n /// assert_eq!(x.zip_with(None= , Point::new), None);\n /// ```\n #[unstable(feature =3D \"option_zip= \", issue =3D \"70086\")]\n #[rustc_const_unstable(feature =3D \"const_o= ption_ext\", issue =3D \"91930\")]\n pub const fn zip_with(self= , other: Option, f: F) -> Option\n where\n F: ~const FnOnce= (T, U) -> R,\n F: ~const Destruct,\n T: ~const Destruct,\n = U: ~const Destruct,\n {\n match (self, other) {\n = (Some(a), Some(b)) =3D> Some(f(a, b)),\n _ =3D> None,\n = }\n }\n}\n\nimpl Option<(T, U)> {\n /// Unzips an option contai= ning a tuple of two options.\n ///\n /// If `self` is `Some((a, b))` = this method returns `(Some(a), Some(b))`.\n /// Otherwise, `(None, None)= ` is returned.\n ///\n /// # Examples\n ///\n /// ```\n /// = #![feature(unzip_option)]\n ///\n /// let x =3D Some((1, \"hi\"));\n = /// let y =3D None::<(u8, u32)>;\n ///\n /// assert_eq!(x.unzip(),= (Some(1), Some(\"hi\")));\n /// assert_eq!(y.unzip(), (None, None));\n = /// ```\n #[inline]\n #[unstable(feature =3D \"unzip_option\", iss= ue =3D \"87800\", reason =3D \"recently added\")]\n pub const fn unzip(s= elf) -> (Option, Option) {\n match self {\n Some((a= , b)) =3D> (Some(a), Some(b)),\n None =3D> (None, None),\n = }\n }\n}\n\nimpl Option<&T> {\n /// Maps an `Option<&T>` to an `= Option` by copying the contents of the\n /// option.\n ///\n //= / # Examples\n ///\n /// ```\n /// let x =3D 12;\n /// let opt_= x =3D Some(&x);\n /// assert_eq!(opt_x, Some(&12));\n /// let copied = =3D opt_x.copied();\n /// assert_eq!(copied, Some(12));\n /// ```\n = #[must_use =3D \"`self` will be dropped if the result is not used\"]\n = #[stable(feature =3D \"copied\", since =3D \"1.35.0\")]\n #[rustc_const= _unstable(feature =3D \"const_option\", issue =3D \"67441\")]\n pub cons= t fn copied(self) -> Option\n where\n T: Copy,\n {\n = // FIXME: this implementation, which sidesteps using `Option::map` since i= t's not const\n // ready yet, should be reverted when possible to av= oid code repetition\n match self {\n Some(&v) =3D> Some(v= ),\n None =3D> None,\n }\n }\n\n /// Maps an `Optio= n<&T>` to an `Option` by cloning the contents of the\n /// option.\n = ///\n /// # Examples\n ///\n /// ```\n /// let x =3D 12;\n = /// let opt_x =3D Some(&x);\n /// assert_eq!(opt_x, Some(&12));\n /= // let cloned =3D opt_x.cloned();\n /// assert_eq!(cloned, Some(12));\n = /// ```\n #[must_use =3D \"`self` will be dropped if the result is no= t used\"]\n #[stable(feature =3D \"rust1\", since =3D \"1.0.0\")]\n #= [rustc_const_unstable(feature =3D \"const_option_cloned\", issue =3D \"9158= 2\")]\n pub const fn cloned(self) -> Option\n where\n T: ~c= onst Clone,\n {\n match self {\n Some(t) =3D> Some(t.c= lone()),\n None =3D> None,\n }\n }\n}\n\nimpl Optio= n<&mut T> {\n /// Maps an `Option<&mut T>` to an `Option` by copying = the contents of the\n /// option.\n ///\n /// # Examples\n ///\= n /// ```\n /// let mut x =3D 12;\n /// let opt_x =3D Some(&mut x)= ;\n /// assert_eq!(opt_x, Some(&mut 12));\n /// let copied =3D opt_x.= copied();\n /// assert_eq!(copied, Some(12));\n /// ```\n #[must_u= se =3D \"`self` will be dropped if the result is not used\"]\n #[stable(= feature =3D \"copied\", since =3D \"1.35.0\")]\n #[rustc_const_unstable(= feature =3D \"const_option_ext\", issue =3D \"91930\")]\n pub const fn c= opied(self) -> Option\n where\n T: Copy,\n {\n match= self {\n Some(&mut t) =3D> Some(t),\n None =3D> None= ,\n }\n }\n\n /// Maps an `Option<&mut T>` to an `Option` b= y cloning the contents of the\n /// option.\n ///\n /// # Examples= \n ///\n /// ```\n /// let mut x =3D 12;\n /// let opt_x =3D So= me(&mut x);\n /// assert_eq!(opt_x, Some(&mut 12));\n /// let cloned = =3D opt_x.cloned();\n /// assert_eq!(cloned, Some(12));\n /// ```\n = #[must_use =3D \"`self` will be dropped if the result is not used\"]\n = #[stable(since =3D \"1.26.0\", feature =3D \"option_ref_mut_cloned\")]\n = #[rustc_const_unstable(feature =3D \"const_option_cloned\", issue =3D \"9= 1582\")]\n pub const fn cloned(self) -> Option\n where\n T:= ~const Clone,\n {\n match self {\n Some(t) =3D> Some(= t.clone()),\n None =3D> None,\n }\n }\n}\n\nimpl= Option> {\n /// Transposes an `Option` of a [`Result`] int= o a [`Result`] of an `Option`.\n ///\n /// [`None`] will be mapped to= [Ok]\\([None]).\n /// [Some]\\([Ok]\\(\\_)) a= nd [Some]\\([Err]\\(\\_)) will be mapped to\n /// [Ok= ]\\([Some]\\(\\_)) and [Err]\\(\\_).\n ///\n /// = # Examples\n ///\n /// ```\n /// #[derive(Debug, Eq, PartialEq)]\n= /// struct SomeErr;\n ///\n /// let x: Result, SomeEr= r> =3D Ok(Some(5));\n /// let y: Option> =3D Some(O= k(5));\n /// assert_eq!(x, y.transpose());\n /// ```\n #[inline]\n= #[stable(feature =3D \"transpose_result\", since =3D \"1.33.0\")]\n = #[rustc_const_unstable(feature =3D \"const_option\", issue =3D \"67441\")]\= n pub const fn transpose(self) -> Result, E> {\n match = self {\n Some(Ok(x)) =3D> Ok(Some(x)),\n Some(Err(e))= =3D> Err(e),\n None =3D> Ok(None),\n }\n }\n}\n\n// T= his is a separate function to reduce the code size of .expect() itself.\n#[= cfg_attr(not(feature =3D \"panic_immediate_abort\"), inline(never))]\n#[cfg= _attr(feature =3D \"panic_immediate_abort\", inline)]\n#[cold]\n#[track_cal= ler]\n#[rustc_const_unstable(feature =3D \"const_option\", issue =3D \"6744= 1\")]\nconst fn expect_failed(msg: &str) -> ! {\n panic_str(msg)\n}\n\n/= ///////////////////////////////////////////////////////////////////////////= /\n// Trait implementations\n//////////////////////////////////////////////= ///////////////////////////////\n\n#[stable(feature =3D \"rust1\", since = =3D \"1.0.0\")]\n#[rustc_const_unstable(feature =3D \"const_clone\", issue = =3D \"91805\")]\nimpl const Clone for Option\nwhere\n T: ~const Cl= one + ~const Destruct,\n{\n #[inline]\n fn clone(&self) -> Self {\n = match self {\n Some(x) =3D> Some(x.clone()),\n = None =3D> None,\n }\n }\n\n #[inline]\n fn clone_from(&mut = self, source: &Self) {\n match (self, source) {\n (Some(t= o), Some(from)) =3D> to.clone_from(from),\n (to, from) =3D> *to = =3D from.clone(),\n }\n }\n}\n\n#[stable(feature =3D \"rust1\", s= ince =3D \"1.0.0\")]\n#[rustc_const_unstable(feature =3D \"const_default_im= pls\", issue =3D \"87864\")]\nimpl const Default for Option {\n //= / Returns [`None`][Option::None].\n ///\n /// # Examples\n ///\n = /// ```\n /// let opt: Option =3D Option::default();\n /// ass= ert!(opt.is_none());\n /// ```\n #[inline]\n fn default() -> Optio= n {\n None\n }\n}\n\n#[stable(feature =3D \"rust1\", since =3D= \"1.0.0\")]\nimpl IntoIterator for Option {\n type Item =3D T;\n = type IntoIter =3D IntoIter;\n\n /// Returns a consuming iterator o= ver the possibly contained value.\n ///\n /// # Examples\n ///\n = /// ```\n /// let x =3D Some(\"string\");\n /// let v: Vec<&str> = =3D x.into_iter().collect();\n /// assert_eq!(v, [\"string\"]);\n ///= \n /// let x =3D None;\n /// let v: Vec<&str> =3D x.into_iter().colle= ct();\n /// assert!(v.is_empty());\n /// ```\n #[inline]\n fn i= nto_iter(self) -> IntoIter {\n IntoIter { inner: Item { opt: self= } }\n }\n}\n\n#[stable(since =3D \"1.4.0\", feature =3D \"option_iter\"= )]\nimpl<'a, T> IntoIterator for &'a Option {\n type Item =3D &'a T;\= n type IntoIter =3D Iter<'a, T>;\n\n fn into_iter(self) -> Iter<'a, T= > {\n self.iter()\n }\n}\n\n#[stable(since =3D \"1.4.0\", feature= =3D \"option_iter\")]\nimpl<'a, T> IntoIterator for &'a mut Option {\n = type Item =3D &'a mut T;\n type IntoIter =3D IterMut<'a, T>;\n\n f= n into_iter(self) -> IterMut<'a, T> {\n self.iter_mut()\n }\n}\n\= n#[stable(since =3D \"1.12.0\", feature =3D \"option_from\")]\n#[rustc_cons= t_unstable(feature =3D \"const_convert\", issue =3D \"88674\")]\nimpl co= nst From for Option {\n /// Moves `val` into a new [`Some`].\n = ///\n /// # Examples\n ///\n /// ```\n /// let o: Option = =3D Option::from(67);\n ///\n /// assert_eq!(Some(67), o);\n /// `= ``\n fn from(val: T) -> Option {\n Some(val)\n }\n}\n\n#[st= able(feature =3D \"option_ref_from_ref_option\", since =3D \"1.30.0\")]\n#[= rustc_const_unstable(feature =3D \"const_convert\", issue =3D \"88674\")]\n= impl<'a, T> const From<&'a Option> for Option<&'a T> {\n /// Converts= from `&Option` to `Option<&T>`.\n ///\n /// # Examples\n ///\n= /// Converts an [Option]<[String]> into an [Option]<= [usize]>, preserving\n /// the original. The [`map`] method takes= the `self` argument by value, consuming the original,\n /// so this tec= hnique uses `from` to first take an [`Option`] to a reference\n /// to t= he value inside the original.\n ///\n /// [`map`]: Option::map\n /= // [String]: ../../std/string/struct.String.html \"String\"\n ///\n /= // ```\n /// let s: Option =3D Some(String::from(\"Hello, Rustac= eans!\"));\n /// let o: Option =3D Option::from(&s).map(|ss: &Str= ing| ss.len());\n ///\n /// println!(\"Can still print s: {s:?}\");\n= ///\n /// assert_eq!(o, Some(18));\n /// ```\n fn from(o: &'a = Option) -> Option<&'a T> {\n o.as_ref()\n }\n}\n\n#[stable(fea= ture =3D \"option_ref_from_ref_option\", since =3D \"1.30.0\")]\n#[rustc_co= nst_unstable(feature =3D \"const_convert\", issue =3D \"88674\")]\nimpl<'a,= T> const From<&'a mut Option> for Option<&'a mut T> {\n /// Converts= from `&mut Option` to `Option<&mut T>`\n ///\n /// # Examples\n = ///\n /// ```\n /// let mut s =3D Some(String::from(\"Hello\"));\n = /// let o: Option<&mut String> =3D Option::from(&mut s);\n ///\n /= // match o {\n /// Some(t) =3D> *t =3D String::from(\"Hello, Rustace= ans!\"),\n /// None =3D> (),\n /// }\n ///\n /// assert_eq!= (s, Some(String::from(\"Hello, Rustaceans!\")));\n /// ```\n fn from(= o: &'a mut Option) -> Option<&'a mut T> {\n o.as_mut()\n }\n}\= n\n////////////////////////////////////////////////////////////////////////= /////\n// The Option Iterators\n///////////////////////////////////////////= //////////////////////////////////\n\n#[derive(Clone, Debug)]\nstruct Item<= A> {\n opt: Option,\n}\n\nimpl Iterator for Item {\n type It= em =3D A;\n\n #[inline]\n fn next(&mut self) -> Option {\n = self.opt.take()\n }\n\n #[inline]\n fn size_hint(&self) -> (usize,= Option) {\n match self.opt {\n Some(_) =3D> (1, S= ome(1)),\n None =3D> (0, Some(0)),\n }\n }\n}\n\nimpl<= A> DoubleEndedIterator for Item {\n #[inline]\n fn next_back(&mut = self) -> Option {\n self.opt.take()\n }\n}\n\nimpl ExactSiz= eIterator for Item {}\nimpl FusedIterator for Item {}\nunsafe impl= TrustedLen for Item {}\n\n/// An iterator over a reference to the [`= Some`] variant of an [`Option`].\n///\n/// The iterator yields one value if= the [`Option`] is a [`Some`], otherwise none.\n///\n/// This `struct` is c= reated by the [`Option::iter`] function.\n#[stable(feature =3D \"rust1\", s= ince =3D \"1.0.0\")]\n#[derive(Debug)]\npub struct Iter<'a, A: 'a> {\n i= nner: Item<&'a A>,\n}\n\n#[stable(feature =3D \"rust1\", since =3D \"1.0.0\= ")]\nimpl<'a, A> Iterator for Iter<'a, A> {\n type Item =3D &'a A;\n\n = #[inline]\n fn next(&mut self) -> Option<&'a A> {\n self.inner.= next()\n }\n #[inline]\n fn size_hint(&self) -> (usize, Option) {\n self.inner.size_hint()\n }\n}\n\n#[stable(feature =3D \"= rust1\", since =3D \"1.0.0\")]\nimpl<'a, A> DoubleEndedIterator for Iter<'a= , A> {\n #[inline]\n fn next_back(&mut self) -> Option<&'a A> {\n = self.inner.next_back()\n }\n}\n\n#[stable(feature =3D \"rust1\", sin= ce =3D \"1.0.0\")]\nimpl ExactSizeIterator for Iter<'_, A> {}\n\n#[stabl= e(feature =3D \"fused\", since =3D \"1.26.0\")]\nimpl FusedIterator for = Iter<'_, A> {}\n\n#[unstable(feature =3D \"trusted_len\", issue =3D \"37572= \")]\nunsafe impl TrustedLen for Iter<'_, A> {}\n\n#[stable(feature =3D = \"rust1\", since =3D \"1.0.0\")]\nimpl Clone for Iter<'_, A> {\n #[in= line]\n fn clone(&self) -> Self {\n Iter { inner: self.inner.clon= e() }\n }\n}\n\n/// An iterator over a mutable reference to the [`Some`]= variant of an [`Option`].\n///\n/// The iterator yields one value if the [= `Option`] is a [`Some`], otherwise none.\n///\n/// This `struct` is created= by the [`Option::iter_mut`] function.\n#[stable(feature =3D \"rust1\", sin= ce =3D \"1.0.0\")]\n#[derive(Debug)]\npub struct IterMut<'a, A: 'a> {\n = inner: Item<&'a mut A>,\n}\n\n#[stable(feature =3D \"rust1\", since =3D \"1= .0.0\")]\nimpl<'a, A> Iterator for IterMut<'a, A> {\n type Item =3D &'a = mut A;\n\n #[inline]\n fn next(&mut self) -> Option<&'a mut A> {\n = self.inner.next()\n }\n #[inline]\n fn size_hint(&self) -> (u= size, Option) {\n self.inner.size_hint()\n }\n}\n\n#[stabl= e(feature =3D \"rust1\", since =3D \"1.0.0\")]\nimpl<'a, A> DoubleEndedIter= ator for IterMut<'a, A> {\n #[inline]\n fn next_back(&mut self) -> Op= tion<&'a mut A> {\n self.inner.next_back()\n }\n}\n\n#[stable(fea= ture =3D \"rust1\", since =3D \"1.0.0\")]\nimpl ExactSizeIterator for It= erMut<'_, A> {}\n\n#[stable(feature =3D \"fused\", since =3D \"1.26.0\")]\n= impl FusedIterator for IterMut<'_, A> {}\n#[unstable(feature =3D \"trust= ed_len\", issue =3D \"37572\")]\nunsafe impl TrustedLen for IterMut<'_, = A> {}\n\n/// An iterator over the value in [`Some`] variant of an [`Option`= ].\n///\n/// The iterator yields one value if the [`Option`] is a [`Some`],= otherwise none.\n///\n/// This `struct` is created by the [`Option::into_i= ter`] function.\n#[derive(Clone, Debug)]\n#[stable(feature =3D \"rust1\", s= ince =3D \"1.0.0\")]\npub struct IntoIter {\n inner: Item,\n}\n\n#= [stable(feature =3D \"rust1\", since =3D \"1.0.0\")]\nimpl Iterator for = IntoIter {\n type Item =3D A;\n\n #[inline]\n fn next(&mut self= ) -> Option {\n self.inner.next()\n }\n #[inline]\n fn s= ize_hint(&self) -> (usize, Option) {\n self.inner.size_hint()= \n }\n}\n\n#[stable(feature =3D \"rust1\", since =3D \"1.0.0\")]\nimpl DoubleEndedIterator for IntoIter {\n #[inline]\n fn next_back(&m= ut self) -> Option {\n self.inner.next_back()\n }\n}\n\n#[stab= le(feature =3D \"rust1\", since =3D \"1.0.0\")]\nimpl ExactSizeIterator = for IntoIter {}\n\n#[stable(feature =3D \"fused\", since =3D \"1.26.0\")= ]\nimpl FusedIterator for IntoIter {}\n\n#[unstable(feature =3D \"tru= sted_len\", issue =3D \"37572\")]\nunsafe impl TrustedLen for IntoIter {}\n\n///////////////////////////////////////////////////////////////////= //////////\n// FromIterator\n//////////////////////////////////////////////= ///////////////////////////////\n\n#[stable(feature =3D \"rust1\", since = =3D \"1.0.0\")]\nimpl> FromIterator> for Op= tion {\n /// Takes each element in the [`Iterator`]: if it is [`None`= ][Option::None],\n /// no further elements are taken, and the [`None`][O= ption::None] is\n /// returned. Should no [`None`][Option::None] occur, = a container of type\n /// `V` containing the values of each [`Option`] i= s returned.\n ///\n /// # Examples\n ///\n /// Here is an examp= le which increments every integer in a vector.\n /// We use the checked = variant of `add` that returns `None` when the\n /// calculation would re= sult in an overflow.\n ///\n /// ```\n /// let items =3D vec![0_u1= 6, 1, 2];\n ///\n /// let res: Option> =3D items\n /// = .iter()\n /// .map(|x| x.checked_add(1))\n /// .collect();\= n ///\n /// assert_eq!(res, Some(vec![1, 2, 3]));\n /// ```\n /= //\n /// As you can see, this will return the expected, valid items.\n = ///\n /// Here is another example that tries to subtract one from anot= her list\n /// of integers, this time checking for underflow:\n ///\n= /// ```\n /// let items =3D vec![2_u16, 1, 0];\n ///\n /// let= res: Option> =3D items\n /// .iter()\n /// .map(|x|= x.checked_sub(1))\n /// .collect();\n ///\n /// assert_eq!(re= s, None);\n /// ```\n ///\n /// Since the last element is zero, it= would underflow. Thus, the resulting\n /// value is `None`.\n ///\n = /// Here is a variation on the previous example, showing that no\n //= / further elements are taken from `iter` after the first `None`.\n ///\n= /// ```\n /// let items =3D vec![3_u16, 2, 1, 10];\n ///\n ///= let mut shared =3D 0;\n ///\n /// let res: Option> =3D item= s\n /// .iter()\n /// .map(|x| { shared +=3D x; x.checked_sub= (2) })\n /// .collect();\n ///\n /// assert_eq!(res, None);\n = /// assert_eq!(shared, 6);\n /// ```\n ///\n /// Since the thir= d element caused an underflow, no further elements were taken,\n /// so = the final value of `shared` is 6 (=3D `3 + 2 + 1`), not 16.\n #[inline]\= n fn from_iter>>(iter: I) -> Option {\n // FIXME(#11084): This could be replaced with Iterator::scan w= hen this\n // performance bug is closed.\n\n iter::try_proces= s(iter.into_iter(), |i| i.collect())\n }\n}\n\n#[unstable(feature =3D \"= try_trait_v2\", issue =3D \"84277\")]\n#[rustc_const_unstable(feature =3D \= "const_convert\", issue =3D \"88674\")]\nimpl const ops::Try for Option<= T> {\n type Output =3D T;\n type Residual =3D Option;\n\n #[inline]\n fn from_output(output: Self::Output) -> Self {\= n Some(output)\n }\n\n #[inline]\n fn branch(self) -> Contr= olFlow {\n match self {\n S= ome(v) =3D> ControlFlow::Continue(v),\n None =3D> ControlFlow::B= reak(None),\n }\n }\n}\n\n#[unstable(feature =3D \"try_trait_v2\"= , issue =3D \"84277\")]\n#[rustc_const_unstable(feature =3D \"const_convert= \", issue =3D \"88674\")]\nimpl const ops::FromResidual for Option {\= n #[inline]\n fn from_residual(residual: Option)= -> Self {\n match residual {\n None =3D> None,\n = }\n }\n}\n\n#[unstable(feature =3D \"try_trait_v2_yeet\", issue =3D \"96= 374\")]\nimpl ops::FromResidual> for Option {\n #[in= line]\n fn from_residual(ops::Yeet(()): ops::Yeet<()>) -> Self {\n = None\n }\n}\n\n#[unstable(feature =3D \"try_trait_v2_residual\", issue= =3D \"91285\")]\nimpl ops::Residual for Option = {\n type TryType =3D Option;\n}\n\nimpl Option> {\n /= // Converts from `Option>` to `Option`.\n ///\n /// # Ex= amples\n ///\n /// Basic usage:\n ///\n /// ```\n /// let x:= Option> =3D Some(Some(6));\n /// assert_eq!(Some(6), x.flat= ten());\n ///\n /// let x: Option> =3D Some(None);\n /= // assert_eq!(None, x.flatten());\n ///\n /// let x: Option> =3D None;\n /// assert_eq!(None, x.flatten());\n /// ```\n ///= \n /// Flattening only removes one level of nesting at a time:\n ///\= n /// ```\n /// let x: Option>> =3D Some(Some(Some= (6)));\n /// assert_eq!(Some(Some(6)), x.flatten());\n /// assert_eq!= (Some(6), x.flatten().flatten());\n /// ```\n #[inline]\n #[stable= (feature =3D \"option_flattening\", since =3D \"1.40.0\")]\n #[rustc_con= st_unstable(feature =3D \"const_option\", issue =3D \"67441\")]\n pub co= nst fn flatten(self) -> Option {\n match self {\n Some= (inner) =3D> inner,\n None =3D> None,\n }\n }\n}\n","u= ri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/l= ib/rustlib/src/rust/library/core/src/option.rs","version":0}}} 17:00:16 DEBUG writer-Some("rust") src/rpcclient.rs:254 =3D> Some("rust") {= "jsonrpc":"2.0","method":"textDocument/codeLens","params":{"textDocument":{= "uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu= /lib/rustlib/src/rust/library/core/src/option.rs"}},"id":3} 17:00:16 DEBUG reader-Some("rust") src/rpcclient.rs:207 <=3D Some("rust") {= "jsonrpc":"2.0","id":3,"result":[{"range":{"start":{"line":537,"character":= 4},"end":{"line":554,"character":5}},"command":{"title":"=E2=96=B6=EF=B8=8E= Run Doctest","command":"rust-analyzer.runSingle","arguments":[{"label":"do= ctest option::Option::is_some","location":{"targetUri":"file:///home/dic= k/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/l= ibrary/core/src/option.rs","targetRange":{"start":{"line":537,"character":4= },"end":{"line":554,"character":5}},"targetSelectionRange":{"start":{"line"= :537,"character":4},"end":{"line":554,"character":5}}},"kind":"cargo","args= ":{"overrideCargo":null,"cargoArgs":["test","--doc"],"cargoExtraArgs":[],"e= xecutableArgs":["option::Option::is_some","--nocapture"]}}]}},{"range":{= "start":{"line":556,"character":4},"end":{"line":577,"character":5}},"comma= nd":{"title":"=E2=96=B6=EF=B8=8E Run Doctest","command":"rust-analyzer.runS= ingle","arguments":[{"label":"doctest option::Option::is_some_and","loca= tion":{"targetUri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unkn= own-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs","targetRange= ":{"start":{"line":556,"character":4},"end":{"line":577,"character":5}},"ta= rgetSelectionRange":{"start":{"line":556,"character":4},"end":{"line":577,"= character":5}}},"kind":"cargo","args":{"overrideCargo":null,"cargoArgs":["t= est","--doc"],"cargoExtraArgs":[],"executableArgs":["option::Option::is_= some_and","--nocapture"]}}]}},{"range":{"start":{"line":579,"character":4},= "end":{"line":597,"character":5}},"command":{"title":"=E2=96=B6=EF=B8=8E Ru= n Doctest","command":"rust-analyzer.runSingle","arguments":[{"label":"docte= st option::Option::is_none","location":{"targetUri":"file:///home/dick/.= rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/libr= ary/core/src/option.rs","targetRange":{"start":{"line":579,"character":4},"= end":{"line":597,"character":5}},"targetSelectionRange":{"start":{"line":57= 9,"character":4},"end":{"line":597,"character":5}}},"kind":"cargo","args":{= "overrideCargo":null,"cargoArgs":["test","--doc"],"cargoExtraArgs":[],"exec= utableArgs":["option::Option::is_none","--nocapture"]}}]}},{"range":{"st= art":{"line":603,"character":4},"end":{"line":630,"character":5}},"command"= :{"title":"=E2=96=B6=EF=B8=8E Run Doctest","command":"rust-analyzer.runSing= le","arguments":[{"label":"doctest option::Option::as_ref","location":{"= targetUri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linu= x-gnu/lib/rustlib/src/rust/library/core/src/option.rs","targetRange":{"star= t":{"line":603,"character":4},"end":{"line":630,"character":5}},"targetSele= ctionRange":{"start":{"line":603,"character":4},"end":{"line":630,"characte= r":5}}},"kind":"cargo","args":{"overrideCargo":null,"cargoArgs":["test","--= doc"],"cargoExtraArgs":[],"executableArgs":["option::Option::as_ref","--= nocapture"]}}]}},{"range":{"start":{"line":632,"character":4},"end":{"line"= :652,"character":5}},"command":{"title":"=E2=96=B6=EF=B8=8E Run Doctest","c= ommand":"rust-analyzer.runSingle","arguments":[{"label":"doctest option::Op= tion::as_mut","location":{"targetUri":"file:///home/dick/.rustup/toolcha= ins/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/o= ption.rs","targetRange":{"start":{"line":632,"character":4},"end":{"line":6= 52,"character":5}},"targetSelectionRange":{"start":{"line":632,"character":= 4},"end":{"line":652,"character":5}}},"kind":"cargo","args":{"overrideCargo= ":null,"cargoArgs":["test","--doc"],"cargoExtraArgs":[],"executableArgs":["= option::Option::as_mut","--nocapture"]}}]}},{"range":{"start":{"line":69= 2,"character":4},"end":{"line":739,"character":5}},"command":{"title":"=E2= =96=B6=EF=B8=8E Run Doctest","command":"rust-analyzer.runSingle","arguments= ":[{"label":"doctest option::Option::expect","location":{"targetUri":"fi= le:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rust= lib/src/rust/library/core/src/option.rs","targetRange":{"start":{"line":692= ,"character":4},"end":{"line":739,"character":5}},"targetSelectionRange":{"= start":{"line":692,"character":4},"end":{"line":739,"character":5}}},"kind"= :"cargo","args":{"overrideCargo":null,"cargoArgs":["test","--doc"],"cargoEx= traArgs":[],"executableArgs":["option::Option::expect","--nocapture"]}}]= }},{"range":{"start":{"line":741,"character":4},"end":{"line":776,"characte= r":5}},"command":{"title":"=E2=96=B6=EF=B8=8E Run Doctest","command":"rust-= analyzer.runSingle","arguments":[{"label":"doctest option::Option::unwra= p","location":{"targetUri":"file:///home/dick/.rustup/toolchains/stable-x86= _64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs","tar= getRange":{"start":{"line":741,"character":4},"end":{"line":776,"character"= :5}},"targetSelectionRange":{"start":{"line":741,"character":4},"end":{"lin= e":776,"character":5}}},"kind":"cargo","args":{"overrideCargo":null,"cargoA= rgs":["test","--doc"],"cargoExtraArgs":[],"executableArgs":["option::Option= ::unwrap","--nocapture"]}}]}},{"range":{"start":{"line":778,"character":= 4},"end":{"line":803,"character":5}},"command":{"title":"=E2=96=B6=EF=B8=8E= Run Doctest","command":"rust-analyzer.runSingle","arguments":[{"label":"do= ctest option::Option::unwrap_or","location":{"targetUri":"file:///home/d= ick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust= /library/core/src/option.rs","targetRange":{"start":{"line":778,"character"= :4},"end":{"line":803,"character":5}},"targetSelectionRange":{"start":{"lin= e":778,"character":4},"end":{"line":803,"character":5}}},"kind":"cargo","ar= gs":{"overrideCargo":null,"cargoArgs":["test","--doc"],"cargoExtraArgs":[],= "executableArgs":["option::Option::unwrap_or","--nocapture"]}}]}},{"rang= e":{"start":{"line":805,"character":4},"end":{"line":826,"character":5}},"c= ommand":{"title":"=E2=96=B6=EF=B8=8E Run Doctest","command":"rust-analyzer.= runSingle","arguments":[{"label":"doctest option::Option::unwrap_or_else= ","location":{"targetUri":"file:///home/dick/.rustup/toolchains/stable-x86_= 64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs","targ= etRange":{"start":{"line":805,"character":4},"end":{"line":826,"character":= 5}},"targetSelectionRange":{"start":{"line":805,"character":4},"end":{"line= ":826,"character":5}}},"kind":"cargo","args":{"overrideCargo":null,"cargoAr= gs":["test","--doc"],"cargoExtraArgs":[],"executableArgs":["option::Option<= T>::unwrap_or_else","--nocapture"]}}]}},{"range":{"start":{"line":828,"char= acter":4},"end":{"line":865,"character":5}},"command":{"title":"=E2=96=B6= =EF=B8=8E Run Doctest","command":"rust-analyzer.runSingle","arguments":[{"l= abel":"doctest option::Option::unwrap_or_default","location":{"targetUri= ":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib= /rustlib/src/rust/library/core/src/option.rs","targetRange":{"start":{"line= ":828,"character":4},"end":{"line":865,"character":5}},"targetSelectionRang= e":{"start":{"line":828,"character":4},"end":{"line":865,"character":5}}},"= kind":"cargo","args":{"overrideCargo":null,"cargoArgs":["test","--doc"],"ca= rgoExtraArgs":[],"executableArgs":["option::Option::unwrap_or_default","= --nocapture"]}}]}},{"range":{"start":{"line":867,"character":4},"end":{"lin= e":898,"character":5}},"command":{"title":"=E2=96=B6=EF=B8=8E Run Doctest",= "command":"rust-analyzer.runSingle","arguments":[{"label":"doctest option::= Option::unwrap_unchecked","location":{"targetUri":"file:///home/dick/.ru= stup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/librar= y/core/src/option.rs","targetRange":{"start":{"line":867,"character":4},"en= d":{"line":898,"character":5}},"targetSelectionRange":{"start":{"line":867,= "character":4},"end":{"line":898,"character":5}}},"kind":"cargo","args":{"o= verrideCargo":null,"cargoArgs":["test","--doc"],"cargoExtraArgs":[],"execut= ableArgs":["option::Option::unwrap_unchecked","--nocapture"]}}]}},{"rang= e":{"start":{"line":904,"character":4},"end":{"line":931,"character":5}},"c= ommand":{"title":"=E2=96=B6=EF=B8=8E Run Doctest","command":"rust-analyzer.= runSingle","arguments":[{"label":"doctest option::Option::map","location= ":{"targetUri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-= linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs","targetRange":{"= start":{"line":904,"character":4},"end":{"line":931,"character":5}},"target= SelectionRange":{"start":{"line":904,"character":4},"end":{"line":931,"char= acter":5}}},"kind":"cargo","args":{"overrideCargo":null,"cargoArgs":["test"= ,"--doc"],"cargoExtraArgs":[],"executableArgs":["option::Option::map","-= -nocapture"]}}]}},{"range":{"start":{"line":933,"character":4},"end":{"line= ":961,"character":5}},"command":{"title":"=E2=96=B6=EF=B8=8E Run Doctest","= command":"rust-analyzer.runSingle","arguments":[{"label":"doctest option::O= ption::inspect","location":{"targetUri":"file:///home/dick/.rustup/toolc= hains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src= /option.rs","targetRange":{"start":{"line":933,"character":4},"end":{"line"= :961,"character":5}},"targetSelectionRange":{"start":{"line":933,"character= ":4},"end":{"line":961,"character":5}}},"kind":"cargo","args":{"overrideCar= go":null,"cargoArgs":["test","--doc"],"cargoExtraArgs":[],"executableArgs":= ["option::Option::inspect","--nocapture"]}}]}},{"range":{"start":{"line"= :963,"character":4},"end":{"line":994,"character":5}},"command":{"title":"= =E2=96=B6=EF=B8=8E Run Doctest","command":"rust-analyzer.runSingle","argume= nts":[{"label":"doctest option::Option::map_or","location":{"targetUri":= "file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/r= ustlib/src/rust/library/core/src/option.rs","targetRange":{"start":{"line":= 963,"character":4},"end":{"line":994,"character":5}},"targetSelectionRange"= :{"start":{"line":963,"character":4},"end":{"line":994,"character":5}}},"ki= nd":"cargo","args":{"overrideCargo":null,"cargoArgs":["test","--doc"],"carg= oExtraArgs":[],"executableArgs":["option::Option::map_or","--nocapture"]= }}]}},{"range":{"start":{"line":996,"character":4},"end":{"line":1024,"char= acter":5}},"command":{"title":"=E2=96=B6=EF=B8=8E Run Doctest","command":"r= ust-analyzer.runSingle","arguments":[{"label":"doctest option::Option::m= ap_or_else","location":{"targetUri":"file:///home/dick/.rustup/toolchains/s= table-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option= .rs","targetRange":{"start":{"line":996,"character":4},"end":{"line":1024,"= character":5}},"targetSelectionRange":{"start":{"line":996,"character":4},"= end":{"line":1024,"character":5}}},"kind":"cargo","args":{"overrideCargo":n= ull,"cargoArgs":["test","--doc"],"cargoExtraArgs":[],"executableArgs":["opt= ion::Option::map_or_else","--nocapture"]}}]}},{"range":{"start":{"line":= 1026,"character":4},"end":{"line":1058,"character":5}},"command":{"title":"= =E2=96=B6=EF=B8=8E Run Doctest","command":"rust-analyzer.runSingle","argume= nts":[{"label":"doctest option::Option::ok_or","location":{"targetUri":"= file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/ru= stlib/src/rust/library/core/src/option.rs","targetRange":{"start":{"line":1= 026,"character":4},"end":{"line":1058,"character":5}},"targetSelectionRange= ":{"start":{"line":1026,"character":4},"end":{"line":1058,"character":5}}},= "kind":"cargo","args":{"overrideCargo":null,"cargoArgs":["test","--doc"],"c= argoExtraArgs":[],"executableArgs":["option::Option::ok_or","--nocapture= "]}}]}},{"range":{"start":{"line":1060,"character":4},"end":{"line":1088,"c= haracter":5}},"command":{"title":"=E2=96=B6=EF=B8=8E Run Doctest","command"= :"rust-analyzer.runSingle","arguments":[{"label":"doctest option::Option= ::ok_or_else","location":{"targetUri":"file:///home/dick/.rustup/toolchains= /stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/opti= on.rs","targetRange":{"start":{"line":1060,"character":4},"end":{"line":108= 8,"character":5}},"targetSelectionRange":{"start":{"line":1060,"character":= 4},"end":{"line":1088,"character":5}}},"kind":"cargo","args":{"overrideCarg= o":null,"cargoArgs":["test","--doc"],"cargoExtraArgs":[],"executableArgs":[= "option::Option::ok_or_else","--nocapture"]}}]}},{"range":{"start":{"lin= e":1090,"character":4},"end":{"line":1114,"character":5}},"command":{"title= ":"=E2=96=B6=EF=B8=8E Run Doctest","command":"rust-analyzer.runSingle","arg= uments":[{"label":"doctest option::Option::as_deref","location":{"target= Uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/= lib/rustlib/src/rust/library/core/src/option.rs","targetRange":{"start":{"l= ine":1090,"character":4},"end":{"line":1114,"character":5}},"targetSelectio= nRange":{"start":{"line":1090,"character":4},"end":{"line":1114,"character"= :5}}},"kind":"cargo","args":{"overrideCargo":null,"cargoArgs":["test","--do= c"],"cargoExtraArgs":[],"executableArgs":["option::Option::as_deref","--= nocapture"]}}]}},{"range":{"start":{"line":1116,"character":4},"end":{"line= ":1140,"character":5}},"command":{"title":"=E2=96=B6=EF=B8=8E Run Doctest",= "command":"rust-analyzer.runSingle","arguments":[{"label":"doctest option::= Option::as_deref_mut","location":{"targetUri":"file:///home/dick/.rustup= /toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/co= re/src/option.rs","targetRange":{"start":{"line":1116,"character":4},"end":= {"line":1140,"character":5}},"targetSelectionRange":{"start":{"line":1116,"= character":4},"end":{"line":1140,"character":5}}},"kind":"cargo","args":{"o= verrideCargo":null,"cargoArgs":["test","--doc"],"cargoExtraArgs":[],"execut= ableArgs":["option::Option::as_deref_mut","--nocapture"]}}]}},{"range":{= "start":{"line":1146,"character":4},"end":{"line":1162,"character":5}},"com= mand":{"title":"=E2=96=B6=EF=B8=8E Run Doctest","command":"rust-analyzer.ru= nSingle","arguments":[{"label":"doctest option::Option::iter","location"= :{"targetUri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-l= inux-gnu/lib/rustlib/src/rust/library/core/src/option.rs","targetRange":{"s= tart":{"line":1146,"character":4},"end":{"line":1162,"character":5}},"targe= tSelectionRange":{"start":{"line":1146,"character":4},"end":{"line":1162,"c= haracter":5}}},"kind":"cargo","args":{"overrideCargo":null,"cargoArgs":["te= st","--doc"],"cargoExtraArgs":[],"executableArgs":["option::Option::iter= ","--nocapture"]}}]}},{"range":{"start":{"line":1164,"character":4},"end":{= "line":1183,"character":5}},"command":{"title":"=E2=96=B6=EF=B8=8E Run Doct= est","command":"rust-analyzer.runSingle","arguments":[{"label":"doctest opt= ion::Option::iter_mut","location":{"targetUri":"file:///home/dick/.rustu= p/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/c= ore/src/option.rs","targetRange":{"start":{"line":1164,"character":4},"end"= :{"line":1183,"character":5}},"targetSelectionRange":{"start":{"line":1164,= "character":4},"end":{"line":1183,"character":5}}},"kind":"cargo","args":{"= overrideCargo":null,"cargoArgs":["test","--doc"],"cargoExtraArgs":[],"execu= tableArgs":["option::Option::iter_mut","--nocapture"]}}]}},{"range":{"st= art":{"line":1189,"character":4},"end":{"line":1222,"character":5}},"comman= d":{"title":"=E2=96=B6=EF=B8=8E Run Doctest","command":"rust-analyzer.runSi= ngle","arguments":[{"label":"doctest option::Option::and","location":{"t= argetUri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux= -gnu/lib/rustlib/src/rust/library/core/src/option.rs","targetRange":{"start= ":{"line":1189,"character":4},"end":{"line":1222,"character":5}},"targetSel= ectionRange":{"start":{"line":1189,"character":4},"end":{"line":1222,"chara= cter":5}}},"kind":"cargo","args":{"overrideCargo":null,"cargoArgs":["test",= "--doc"],"cargoExtraArgs":[],"executableArgs":["option::Option::and","--= nocapture"]}}]}},{"range":{"start":{"line":1224,"character":4},"end":{"line= ":1264,"character":5}},"command":{"title":"=E2=96=B6=EF=B8=8E Run Doctest",= "command":"rust-analyzer.runSingle","arguments":[{"label":"doctest option::= Option::and_then","location":{"targetUri":"file:///home/dick/.rustup/too= lchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/s= rc/option.rs","targetRange":{"start":{"line":1224,"character":4},"end":{"li= ne":1264,"character":5}},"targetSelectionRange":{"start":{"line":1224,"char= acter":4},"end":{"line":1264,"character":5}}},"kind":"cargo","args":{"overr= ideCargo":null,"cargoArgs":["test","--doc"],"cargoExtraArgs":[],"executable= Args":["option::Option::and_then","--nocapture"]}}]}},{"range":{"start":= {"line":1266,"character":4},"end":{"line":1305,"character":5}},"command":{"= title":"=E2=96=B6=EF=B8=8E Run Doctest","command":"rust-analyzer.runSingle"= ,"arguments":[{"label":"doctest option::Option::filter","location":{"tar= getUri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-g= nu/lib/rustlib/src/rust/library/core/src/option.rs","targetRange":{"start":= {"line":1266,"character":4},"end":{"line":1305,"character":5}},"targetSelec= tionRange":{"start":{"line":1266,"character":4},"end":{"line":1305,"charact= er":5}}},"kind":"cargo","args":{"overrideCargo":null,"cargoArgs":["test","-= -doc"],"cargoExtraArgs":[],"executableArgs":["option::Option::filter","-= -nocapture"]}}]}},{"range":{"start":{"line":1307,"character":4},"end":{"lin= e":1345,"character":5}},"command":{"title":"=E2=96=B6=EF=B8=8E Run Doctest"= ,"command":"rust-analyzer.runSingle","arguments":[{"label":"doctest option:= :Option::or","location":{"targetUri":"file:///home/dick/.rustup/toolchai= ns/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/op= tion.rs","targetRange":{"start":{"line":1307,"character":4},"end":{"line":1= 345,"character":5}},"targetSelectionRange":{"start":{"line":1307,"character= ":4},"end":{"line":1345,"character":5}}},"kind":"cargo","args":{"overrideCa= rgo":null,"cargoArgs":["test","--doc"],"cargoExtraArgs":[],"executableArgs"= :["option::Option::or","--nocapture"]}}]}},{"range":{"start":{"line":134= 7,"character":4},"end":{"line":1372,"character":5}},"command":{"title":"=E2= =96=B6=EF=B8=8E Run Doctest","command":"rust-analyzer.runSingle","arguments= ":[{"label":"doctest option::Option::or_else","location":{"targetUri":"f= ile:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rus= tlib/src/rust/library/core/src/option.rs","targetRange":{"start":{"line":13= 47,"character":4},"end":{"line":1372,"character":5}},"targetSelectionRange"= :{"start":{"line":1347,"character":4},"end":{"line":1372,"character":5}}},"= kind":"cargo","args":{"overrideCargo":null,"cargoArgs":["test","--doc"],"ca= rgoExtraArgs":[],"executableArgs":["option::Option::or_else","--nocaptur= e"]}}]}},{"range":{"start":{"line":1374,"character":4},"end":{"line":1407,"= character":5}},"command":{"title":"=E2=96=B6=EF=B8=8E Run Doctest","command= ":"rust-analyzer.runSingle","arguments":[{"label":"doctest option::Option::xor","location":{"targetUri":"file:///home/dick/.rustup/toolchains/stabl= e-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"= ,"targetRange":{"start":{"line":1374,"character":4},"end":{"line":1407,"cha= racter":5}},"targetSelectionRange":{"start":{"line":1374,"character":4},"en= d":{"line":1407,"character":5}}},"kind":"cargo","args":{"overrideCargo":nul= l,"cargoArgs":["test","--doc"],"cargoExtraArgs":[],"executableArgs":["optio= n::Option::xor","--nocapture"]}}]}},{"range":{"start":{"line":1413,"char= acter":4},"end":{"line":1444,"character":5}},"command":{"title":"=E2=96=B6= =EF=B8=8E Run Doctest","command":"rust-analyzer.runSingle","arguments":[{"l= abel":"doctest option::Option::insert","location":{"targetUri":"file:///= home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/sr= c/rust/library/core/src/option.rs","targetRange":{"start":{"line":1413,"cha= racter":4},"end":{"line":1444,"character":5}},"targetSelectionRange":{"star= t":{"line":1413,"character":4},"end":{"line":1444,"character":5}}},"kind":"= cargo","args":{"overrideCargo":null,"cargoArgs":["test","--doc"],"cargoExtr= aArgs":[],"executableArgs":["option::Option::insert","--nocapture"]}}]}}= ,{"range":{"start":{"line":1446,"character":4},"end":{"line":1480,"characte= r":5}},"command":{"title":"=E2=96=B6=EF=B8=8E Run Doctest","command":"rust-= analyzer.runSingle","arguments":[{"label":"doctest option::Option::get_o= r_insert","location":{"targetUri":"file:///home/dick/.rustup/toolchains/sta= ble-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.r= s","targetRange":{"start":{"line":1446,"character":4},"end":{"line":1480,"c= haracter":5}},"targetSelectionRange":{"start":{"line":1446,"character":4},"= end":{"line":1480,"character":5}}},"kind":"cargo","args":{"overrideCargo":n= ull,"cargoArgs":["test","--doc"],"cargoExtraArgs":[],"executableArgs":["opt= ion::Option::get_or_insert","--nocapture"]}}]}},{"range":{"start":{"line= ":1482,"character":4},"end":{"line":1513,"character":5}},"command":{"title"= :"=E2=96=B6=EF=B8=8E Run Doctest","command":"rust-analyzer.runSingle","argu= ments":[{"label":"doctest option::Option::get_or_insert_default","locati= on":{"targetUri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknow= n-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs","targetRange":= {"start":{"line":1482,"character":4},"end":{"line":1513,"character":5}},"ta= rgetSelectionRange":{"start":{"line":1482,"character":4},"end":{"line":1513= ,"character":5}}},"kind":"cargo","args":{"overrideCargo":null,"cargoArgs":[= "test","--doc"],"cargoExtraArgs":[],"executableArgs":["option::Option::g= et_or_insert_default","--nocapture"]}}]}},{"range":{"start":{"line":1515,"c= haracter":4},"end":{"line":1549,"character":5}},"command":{"title":"=E2=96= =B6=EF=B8=8E Run Doctest","command":"rust-analyzer.runSingle","arguments":[= {"label":"doctest option::Option::get_or_insert_with","location":{"targe= tUri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu= /lib/rustlib/src/rust/library/core/src/option.rs","targetRange":{"start":{"= line":1515,"character":4},"end":{"line":1549,"character":5}},"targetSelecti= onRange":{"start":{"line":1515,"character":4},"end":{"line":1549,"character= ":5}}},"kind":"cargo","args":{"overrideCargo":null,"cargoArgs":["test","--d= oc"],"cargoExtraArgs":[],"executableArgs":["option::Option::get_or_inser= t_with","--nocapture"]}}]}},{"range":{"start":{"line":1555,"character":4},"= end":{"line":1576,"character":5}},"command":{"title":"=E2=96=B6=EF=B8=8E Ru= n Doctest","command":"rust-analyzer.runSingle","arguments":[{"label":"docte= st option::Option::take","location":{"targetUri":"file:///home/dick/.rus= tup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library= /core/src/option.rs","targetRange":{"start":{"line":1555,"character":4},"en= d":{"line":1576,"character":5}},"targetSelectionRange":{"start":{"line":155= 5,"character":4},"end":{"line":1576,"character":5}}},"kind":"cargo","args":= {"overrideCargo":null,"cargoArgs":["test","--doc"],"cargoExtraArgs":[],"exe= cutableArgs":["option::Option::take","--nocapture"]}}]}},{"range":{"star= t":{"line":1578,"character":4},"end":{"line":1600,"character":5}},"command"= :{"title":"=E2=96=B6=EF=B8=8E Run Doctest","command":"rust-analyzer.runSing= le","arguments":[{"label":"doctest option::Option::replace","location":{= "targetUri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-lin= ux-gnu/lib/rustlib/src/rust/library/core/src/option.rs","targetRange":{"sta= rt":{"line":1578,"character":4},"end":{"line":1600,"character":5}},"targetS= electionRange":{"start":{"line":1578,"character":4},"end":{"line":1600,"cha= racter":5}}},"kind":"cargo","args":{"overrideCargo":null,"cargoArgs":["test= ","--doc"],"cargoExtraArgs":[],"executableArgs":["option::Option::replac= e","--nocapture"]}}]}},{"range":{"start":{"line":1602,"character":4},"end":= {"line":1630,"character":5}},"command":{"title":"=E2=96=B6=EF=B8=8E Run Doc= test","command":"rust-analyzer.runSingle","arguments":[{"label":"doctest op= tion::Option::contains","location":{"targetUri":"file:///home/dick/.rust= up/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/= core/src/option.rs","targetRange":{"start":{"line":1602,"character":4},"end= ":{"line":1630,"character":5}},"targetSelectionRange":{"start":{"line":1602= ,"character":4},"end":{"line":1630,"character":5}}},"kind":"cargo","args":{= "overrideCargo":null,"cargoArgs":["test","--doc"],"cargoExtraArgs":[],"exec= utableArgs":["option::Option::contains","--nocapture"]}}]}},{"range":{"s= tart":{"line":1632,"character":4},"end":{"line":1658,"character":5}},"comma= nd":{"title":"=E2=96=B6=EF=B8=8E Run Doctest","command":"rust-analyzer.runS= ingle","arguments":[{"label":"doctest option::Option::zip","location":{"= targetUri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linu= x-gnu/lib/rustlib/src/rust/library/core/src/option.rs","targetRange":{"star= t":{"line":1632,"character":4},"end":{"line":1658,"character":5}},"targetSe= lectionRange":{"start":{"line":1632,"character":4},"end":{"line":1658,"char= acter":5}}},"kind":"cargo","args":{"overrideCargo":null,"cargoArgs":["test"= ,"--doc"],"cargoExtraArgs":[],"executableArgs":["option::Option::zip","-= -nocapture"]}}]}},{"range":{"start":{"line":1660,"character":4},"end":{"lin= e":1701,"character":5}},"command":{"title":"=E2=96=B6=EF=B8=8E Run Doctest"= ,"command":"rust-analyzer.runSingle","arguments":[{"label":"doctest option:= :Option::zip_with","location":{"targetUri":"file:///home/dick/.rustup/to= olchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/= src/option.rs","targetRange":{"start":{"line":1660,"character":4},"end":{"l= ine":1701,"character":5}},"targetSelectionRange":{"start":{"line":1660,"cha= racter":4},"end":{"line":1701,"character":5}}},"kind":"cargo","args":{"over= rideCargo":null,"cargoArgs":["test","--doc"],"cargoExtraArgs":[],"executabl= eArgs":["option::Option::zip_with","--nocapture"]}}]}},{"range":{"start"= :{"line":1705,"character":4},"end":{"line":1728,"character":5}},"command":{= "title":"=E2=96=B6=EF=B8=8E Run Doctest","command":"rust-analyzer.runSingle= ","arguments":[{"label":"doctest option::Option<(T,U)>::unzip","location":{= "targetUri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-lin= ux-gnu/lib/rustlib/src/rust/library/core/src/option.rs","targetRange":{"sta= rt":{"line":1705,"character":4},"end":{"line":1728,"character":5}},"targetS= electionRange":{"start":{"line":1705,"character":4},"end":{"line":1728,"cha= racter":5}}},"kind":"cargo","args":{"overrideCargo":null,"cargoArgs":["test= ","--doc"],"cargoExtraArgs":[],"executableArgs":["option::Option<(T,U)>::un= zip","--nocapture"]}}]}},{"range":{"start":{"line":1732,"character":4},"end= ":{"line":1757,"character":5}},"command":{"title":"=E2=96=B6=EF=B8=8E Run D= octest","command":"rust-analyzer.runSingle","arguments":[{"label":"doctest = option::Option<&T>::copied","location":{"targetUri":"file:///home/dick/.rus= tup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library= /core/src/option.rs","targetRange":{"start":{"line":1732,"character":4},"en= d":{"line":1757,"character":5}},"targetSelectionRange":{"start":{"line":173= 2,"character":4},"end":{"line":1757,"character":5}}},"kind":"cargo","args":= {"overrideCargo":null,"cargoArgs":["test","--doc"],"cargoExtraArgs":[],"exe= cutableArgs":["option::Option<&T>::copied","--nocapture"]}}]}},{"range":{"s= tart":{"line":1759,"character":4},"end":{"line":1782,"character":5}},"comma= nd":{"title":"=E2=96=B6=EF=B8=8E Run Doctest","command":"rust-analyzer.runS= ingle","arguments":[{"label":"doctest option::Option<&T>::cloned","location= ":{"targetUri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-= linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs","targetRange":{"= start":{"line":1759,"character":4},"end":{"line":1782,"character":5}},"targ= etSelectionRange":{"start":{"line":1759,"character":4},"end":{"line":1782,"= character":5}}},"kind":"cargo","args":{"overrideCargo":null,"cargoArgs":["t= est","--doc"],"cargoExtraArgs":[],"executableArgs":["option::Option<&T>::cl= oned","--nocapture"]}}]}},{"range":{"start":{"line":1786,"character":4},"en= d":{"line":1809,"character":5}},"command":{"title":"=E2=96=B6=EF=B8=8E Run = Doctest","command":"rust-analyzer.runSingle","arguments":[{"label":"doctest= option::Option<&mutT>::copied","location":{"targetUri":"file:///home/dick/= .rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/lib= rary/core/src/option.rs","targetRange":{"start":{"line":1786,"character":4}= ,"end":{"line":1809,"character":5}},"targetSelectionRange":{"start":{"line"= :1786,"character":4},"end":{"line":1809,"character":5}}},"kind":"cargo","ar= gs":{"overrideCargo":null,"cargoArgs":["test","--doc"],"cargoExtraArgs":[],= "executableArgs":["option::Option<&mutT>::copied","--nocapture"]}}]}},{"ran= ge":{"start":{"line":1811,"character":4},"end":{"line":1834,"character":5}}= ,"command":{"title":"=E2=96=B6=EF=B8=8E Run Doctest","command":"rust-analyz= er.runSingle","arguments":[{"label":"doctest option::Option<&mutT>::cloned"= ,"location":{"targetUri":"file:///home/dick/.rustup/toolchains/stable-x86_6= 4-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs","targe= tRange":{"start":{"line":1811,"character":4},"end":{"line":1834,"character"= :5}},"targetSelectionRange":{"start":{"line":1811,"character":4},"end":{"li= ne":1834,"character":5}}},"kind":"cargo","args":{"overrideCargo":null,"carg= oArgs":["test","--doc"],"cargoExtraArgs":[],"executableArgs":["option::Opti= on<&mutT>::cloned","--nocapture"]}}]}},{"range":{"start":{"line":1838,"char= acter":4},"end":{"line":1863,"character":5}},"command":{"title":"=E2=96=B6= =EF=B8=8E Run Doctest","command":"rust-analyzer.runSingle","arguments":[{"l= abel":"doctest option::Option>::transpose","location":{"targetU= ri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/l= ib/rustlib/src/rust/library/core/src/option.rs","targetRange":{"start":{"li= ne":1838,"character":4},"end":{"line":1863,"character":5}},"targetSelection= Range":{"start":{"line":1838,"character":4},"end":{"line":1863,"character":= 5}}},"kind":"cargo","args":{"overrideCargo":null,"cargoArgs":["test","--doc= "],"cargoExtraArgs":[],"executableArgs":["option::Option>::tran= spose","--nocapture"]}}]}},{"range":{"start":{"line":1906,"character":4},"e= nd":{"line":1917,"character":5}},"command":{"title":"=E2=96=B6=EF=B8=8E Run= Doctest","command":"rust-analyzer.runSingle","arguments":[{"label":"doctes= t option::Option::default","location":{"targetUri":"file:///home/dick/.r= ustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/libra= ry/core/src/option.rs","targetRange":{"start":{"line":1906,"character":4},"= end":{"line":1917,"character":5}},"targetSelectionRange":{"start":{"line":1= 906,"character":4},"end":{"line":1917,"character":5}}},"kind":"cargo","args= ":{"overrideCargo":null,"cargoArgs":["test","--doc"],"cargoExtraArgs":[],"e= xecutableArgs":["option::Option::default","--nocapture"]}}]}},{"range":{= "start":{"line":1925,"character":4},"end":{"line":1941,"character":5}},"com= mand":{"title":"=E2=96=B6=EF=B8=8E Run Doctest","command":"rust-analyzer.ru= nSingle","arguments":[{"label":"doctest option::Option::into_iter","loca= tion":{"targetUri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unkn= own-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs","targetRange= ":{"start":{"line":1925,"character":4},"end":{"line":1941,"character":5}},"= targetSelectionRange":{"start":{"line":1925,"character":4},"end":{"line":19= 41,"character":5}}},"kind":"cargo","args":{"overrideCargo":null,"cargoArgs"= :["test","--doc"],"cargoExtraArgs":[],"executableArgs":["option::Option:= :into_iter","--nocapture"]}}]}},{"range":{"start":{"line":1967,"character":= 4},"end":{"line":1978,"character":5}},"command":{"title":"=E2=96=B6=EF=B8= =8E Run Doctest","command":"rust-analyzer.runSingle","arguments":[{"label":= "doctest option::Option::from","location":{"targetUri":"file:///home/dic= k/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/l= ibrary/core/src/option.rs","targetRange":{"start":{"line":1967,"character":= 4},"end":{"line":1978,"character":5}},"targetSelectionRange":{"start":{"lin= e":1967,"character":4},"end":{"line":1978,"character":5}}},"kind":"cargo","= args":{"overrideCargo":null,"cargoArgs":["test","--doc"],"cargoExtraArgs":[= ],"executableArgs":["option::Option::from","--nocapture"]}}]}},{"range":= {"start":{"line":1984,"character":4},"end":{"line":2006,"character":5}},"co= mmand":{"title":"=E2=96=B6=EF=B8=8E Run Doctest","command":"rust-analyzer.r= unSingle","arguments":[{"label":"doctest option::Option<&T>::from","locatio= n":{"targetUri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown= -linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs","targetRange":{= "start":{"line":1984,"character":4},"end":{"line":2006,"character":5}},"tar= getSelectionRange":{"start":{"line":1984,"character":4},"end":{"line":2006,= "character":5}}},"kind":"cargo","args":{"overrideCargo":null,"cargoArgs":["= test","--doc"],"cargoExtraArgs":[],"executableArgs":["option::Option<&T>::f= rom","--nocapture"]}}]}},{"range":{"start":{"line":2012,"character":4},"end= ":{"line":2029,"character":5}},"command":{"title":"=E2=96=B6=EF=B8=8E Run D= octest","command":"rust-analyzer.runSingle","arguments":[{"label":"doctest = option::Option<&mutT>::from","location":{"targetUri":"file:///home/dick/.ru= stup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/librar= y/core/src/option.rs","targetRange":{"start":{"line":2012,"character":4},"e= nd":{"line":2029,"character":5}},"targetSelectionRange":{"start":{"line":20= 12,"character":4},"end":{"line":2029,"character":5}}},"kind":"cargo","args"= :{"overrideCargo":null,"cargoArgs":["test","--doc"],"cargoExtraArgs":[],"ex= ecutableArgs":["option::Option<&mutT>::from","--nocapture"]}}]}},{"range":{= "start":{"line":2208,"character":4},"end":{"line":2274,"character":5}},"com= mand":{"title":"=E2=96=B6=EF=B8=8E Run Doctest","command":"rust-analyzer.ru= nSingle","arguments":[{"label":"doctest option::Option::from_iter","loca= tion":{"targetUri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unkn= own-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs","targetRange= ":{"start":{"line":2208,"character":4},"end":{"line":2274,"character":5}},"= targetSelectionRange":{"start":{"line":2208,"character":4},"end":{"line":22= 74,"character":5}}},"kind":"cargo","args":{"overrideCargo":null,"cargoArgs"= :["test","--doc"],"cargoExtraArgs":[],"executableArgs":["option::Option:= :from_iter","--nocapture"]}}]}},{"range":{"start":{"line":2322,"character":= 4},"end":{"line":2354,"character":5}},"command":{"title":"=E2=96=B6=EF=B8= =8E Run Doctest","command":"rust-analyzer.runSingle","arguments":[{"label":= "doctest option::Option>::flatten","location":{"targetUri":"file:= ///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib= /src/rust/library/core/src/option.rs","targetRange":{"start":{"line":2322,"= character":4},"end":{"line":2354,"character":5}},"targetSelectionRange":{"s= tart":{"line":2322,"character":4},"end":{"line":2354,"character":5}}},"kind= ":"cargo","args":{"overrideCargo":null,"cargoArgs":["test","--doc"],"cargoE= xtraArgs":[],"executableArgs":["option::Option>::flatten","--noca= pture"]}}]}},{"range":{"start":{"line":517,"character":9},"end":{"line":517= ,"character":15}},"data":{"impls":{"textDocument":{"uri":"file:///home/dick= /.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/li= brary/core/src/option.rs"},"position":{"line":517,"character":9}}}},{"range= ":{"start":{"line":2037,"character":7},"end":{"line":2037,"character":11}},= "data":{"impls":{"textDocument":{"uri":"file:///home/dick/.rustup/toolchain= s/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/opt= ion.rs"},"position":{"line":2037,"character":7}}}},{"range":{"start":{"line= ":2076,"character":11},"end":{"line":2076,"character":15}},"data":{"impls":= {"textDocument":{"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-= unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"},"positi= on":{"line":2076,"character":11}}}},{"range":{"start":{"line":2126,"charact= er":11},"end":{"line":2126,"character":18}},"data":{"impls":{"textDocument"= :{"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-g= nu/lib/rustlib/src/rust/library/core/src/option.rs"},"position":{"line":212= 6,"character":11}}}},{"range":{"start":{"line":2167,"character":11},"end":{= "line":2167,"character":19}},"data":{"impls":{"textDocument":{"uri":"file:/= //home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/= src/rust/library/core/src/option.rs"},"position":{"line":2167,"character":1= 1}}}}]} 17:00:16 DEBUG writer-Some("rust") src/rpcclient.rs:254 =3D> Some("rust") {= "jsonrpc":"2.0","method":"codeLens/resolve","params":{"data":{"impls":{"pos= ition":{"character":9,"line":517},"textDocument":{"uri":"file:///home/dick/= .rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/lib= rary/core/src/option.rs"}}},"range":{"end":{"character":15,"line":517},"sta= rt":{"character":9,"line":517}}},"id":4} 17:00:16 DEBUG reader-Some("rust") src/rpcclient.rs:207 <=3D Some("rust") {= "jsonrpc":"2.0","id":4,"result":{"range":{"start":{"line":517,"character":9= },"end":{"line":517,"character":15}},"command":{"title":"75 implementations= ","command":"rust-analyzer.showReferences","arguments":["file:///home/dick/= .rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/lib= rary/core/src/option.rs",{"line":517,"character":9},[{"uri":"file:///home/d= ick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust= /library/core/src/option.rs","range":{"start":{"line":532,"character":0},"e= nd":{"line":1702,"character":1}}},{"uri":"file:///home/dick/.rustup/toolcha= ins/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/o= ption.rs","range":{"start":{"line":1704,"character":0},"end":{"line":1729,"= character":1}}},{"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-= unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs","range":= {"start":{"line":1731,"character":0},"end":{"line":1783,"character":1}}},{"= uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/= lib/rustlib/src/rust/library/core/src/option.rs","range":{"start":{"line":1= 785,"character":0},"end":{"line":1835,"character":1}}},{"uri":"file:///home= /dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/ru= st/library/core/src/option.rs","range":{"start":{"line":1837,"character":0}= ,"end":{"line":1864,"character":1}}},{"uri":"file:///home/dick/.rustup/tool= chains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/sr= c/option.rs","range":{"start":{"line":2321,"character":0},"end":{"line":235= 5,"character":1}}},{"uri":"file:///home/dick/.rustup/toolchains/stable-x86_= 64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/is_zero.rs"= ,"range":{"start":{"line":72,"character":0},"end":{"line":77,"character":1}= }},{"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux= -gnu/lib/rustlib/src/rust/library/alloc/src/vec/is_zero.rs","range":{"start= ":{"line":79,"character":0},"end":{"line":84,"character":1}}},{"uri":"file:= ///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib= /src/rust/library/alloc/src/vec/is_zero.rs","range":{"start":{"line":104,"c= haracter":0},"end":{"line":117,"character":2}}},{"uri":"file:///home/dick/.= rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/libr= ary/alloc/src/vec/is_zero.rs","range":{"start":{"line":104,"character":0},"= end":{"line":117,"character":2}}},{"uri":"file:///home/dick/.rustup/toolcha= ins/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/= vec/is_zero.rs","range":{"start":{"line":104,"character":0},"end":{"line":1= 17,"character":2}}},{"uri":"file:///home/dick/.rustup/toolchains/stable-x86= _64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/is_zero.rs= ","range":{"start":{"line":104,"character":0},"end":{"line":117,"character"= :2}}},{"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-li= nux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/is_zero.rs","range":{"st= art":{"line":104,"character":0},"end":{"line":117,"character":2}}},{"uri":"= file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/ru= stlib/src/rust/library/alloc/src/vec/is_zero.rs","range":{"start":{"line":1= 04,"character":0},"end":{"line":117,"character":2}}},{"uri":"file:///home/d= ick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust= /library/alloc/src/vec/is_zero.rs","range":{"start":{"line":104,"character"= :0},"end":{"line":117,"character":2}}},{"uri":"file:///home/dick/.rustup/to= olchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc= /src/vec/is_zero.rs","range":{"start":{"line":104,"character":0},"end":{"li= ne":117,"character":2}}},{"uri":"file:///home/dick/.rustup/toolchains/stabl= e-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/is_ze= ro.rs","range":{"start":{"line":104,"character":0},"end":{"line":117,"chara= cter":2}}},{"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unkno= wn-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/is_zero.rs","range"= :{"start":{"line":104,"character":0},"end":{"line":117,"character":2}}},{"u= ri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/l= ib/rustlib/src/rust/library/alloc/src/vec/is_zero.rs","range":{"start":{"li= ne":104,"character":0},"end":{"line":117,"character":2}}},{"uri":"file:///h= ome/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src= /rust/library/alloc/src/vec/is_zero.rs","range":{"start":{"line":104,"chara= cter":0},"end":{"line":117,"character":2}}},{"uri":"file:///home/dick/.rust= up/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/= core/src/option.rs","range":{"start":{"line":514,"character":0},"end":{"lin= e":514,"character":60}}},{"uri":"file:///home/dick/.rustup/toolchains/stabl= e-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"= ,"range":{"start":{"line":2297,"character":0},"end":{"line":2306,"character= ":1}}},{"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-l= inux-gnu/lib/rustlib/src/rust/library/core/src/option.rs","range":{"start":= {"line":2308,"character":0},"end":{"line":2314,"character":1}}},{"uri":"fil= e:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustl= ib/src/rust/library/core/src/option.rs","range":{"start":{"line":2206,"char= acter":0},"end":{"line":2275,"character":1}}},{"uri":"file:///home/dick/.ru= stup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/librar= y/core/src/option.rs","range":{"start":{"line":514,"character":0},"end":{"l= ine":514,"character":60}}},{"uri":"file:///home/dick/.rustup/toolchains/sta= ble-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.r= s","range":{"start":{"line":1964,"character":0},"end":{"line":1979,"charact= er":1}}},{"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown= -linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs","range":{"start= ":{"line":1981,"character":0},"end":{"line":2007,"character":1}}},{"uri":"f= ile:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rus= tlib/src/rust/library/core/src/option.rs","range":{"start":{"line":2009,"ch= aracter":0},"end":{"line":2030,"character":1}}},{"uri":"file:///home/dick/.= rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/libr= ary/core/src/option.rs","range":{"start":{"line":1880,"character":0},"end":= {"line":1901,"character":1}}},{"uri":"file:///home/dick/.rustup/toolchains/= stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/optio= n.rs","range":{"start":{"line":514,"character":0},"end":{"line":514,"charac= ter":60}}},{"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unkno= wn-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs","range":{"sta= rt":{"line":2277,"character":0},"end":{"line":2295,"character":1}}},{"uri":= "file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/r= ustlib/src/rust/library/core/src/iter/traits/accum.rs","range":{"start":{"l= ine":216,"character":0},"end":{"line":230,"character":1}}},{"uri":"file:///= home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/sr= c/rust/library/core/src/option.rs","range":{"start":{"line":514,"character"= :0},"end":{"line":514,"character":60}}},{"uri":"file:///home/dick/.rustup/t= oolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core= /src/option.rs","range":{"start":{"line":2316,"character":0},"end":{"line":= 2319,"character":1}}},{"uri":"file:///home/dick/.rustup/toolchains/stable-x= 86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs","r= ange":{"start":{"line":1920,"character":0},"end":{"line":1942,"character":1= }}},{"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linu= x-gnu/lib/rustlib/src/rust/library/core/src/option.rs","range":{"start":{"l= ine":1944,"character":0},"end":{"line":1952,"character":1}}},{"uri":"file:/= //home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/= src/rust/library/core/src/option.rs","range":{"start":{"line":1954,"charact= er":0},"end":{"line":1962,"character":1}}},{"uri":"file:///home/dick/.rustu= p/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/c= ore/src/option.rs","range":{"start":{"line":514,"character":0},"end":{"line= ":514,"character":60}}},{"uri":"file:///home/dick/.rustup/toolchains/stable= -x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/cmp.r= s","range":{"start":{"line":149,"character":0},"end":{"line":157,"character= ":1}}},{"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-l= inux-gnu/lib/rustlib/src/rust/library/core/src/option.rs","range":{"start":= {"line":514,"character":0},"end":{"line":514,"character":60}}},{"uri":"file= :///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustli= b/src/rust/library/core/src/array/equality.rs","range":{"start":{"line":198= ,"character":0},"end":{"line":215,"character":2}}},{"uri":"file:///home/dic= k/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/l= ibrary/core/src/array/equality.rs","range":{"start":{"line":198,"character"= :0},"end":{"line":215,"character":2}}},{"uri":"file:///home/dick/.rustup/to= olchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/= src/array/equality.rs","range":{"start":{"line":198,"character":0},"end":{"= line":215,"character":2}}},{"uri":"file:///home/dick/.rustup/toolchains/sta= ble-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/array/eq= uality.rs","range":{"start":{"line":198,"character":0},"end":{"line":215,"c= haracter":2}}},{"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-u= nknown-linux-gnu/lib/rustlib/src/rust/library/core/src/array/equality.rs","= range":{"start":{"line":198,"character":0},"end":{"line":215,"character":2}= }},{"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux= -gnu/lib/rustlib/src/rust/library/core/src/array/equality.rs","range":{"sta= rt":{"line":198,"character":0},"end":{"line":215,"character":2}}},{"uri":"f= ile:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rus= tlib/src/rust/library/core/src/array/equality.rs","range":{"start":{"line":= 198,"character":0},"end":{"line":215,"character":2}}},{"uri":"file:///home/= dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rus= t/library/core/src/array/equality.rs","range":{"start":{"line":198,"charact= er":0},"end":{"line":215,"character":2}}},{"uri":"file:///home/dick/.rustup= /toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/co= re/src/array/equality.rs","range":{"start":{"line":198,"character":0},"end"= :{"line":215,"character":2}}},{"uri":"file:///home/dick/.rustup/toolchains/= stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/array= /equality.rs","range":{"start":{"line":198,"character":0},"end":{"line":215= ,"character":2}}},{"uri":"file:///home/dick/.rustup/toolchains/stable-x86_6= 4-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/array/equality.rs= ","range":{"start":{"line":198,"character":0},"end":{"line":215,"character"= :2}}},{"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-li= nux-gnu/lib/rustlib/src/rust/library/core/src/array/equality.rs","range":{"= start":{"line":198,"character":0},"end":{"line":215,"character":2}}},{"uri"= :"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/= rustlib/src/rust/library/core/src/iter/traits/accum.rs","range":{"start":{"= line":189,"character":0},"end":{"line":214,"character":1}}},{"uri":"file://= /home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/s= rc/rust/library/core/src/option.rs","range":{"start":{"line":1903,"characte= r":0},"end":{"line":1918,"character":1}}},{"uri":"file:///home/dick/.rustup= /toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/co= re/src/option.rs","range":{"start":{"line":514,"character":0},"end":{"line"= :514,"character":60}}},{"uri":"file:///home/dick/.rustup/toolchains/stable-= x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/proc_macro/src/bridge= /mod.rs","range":{"start":{"line":421,"character":0},"end":{"line":426,"cha= racter":2}}},{"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unk= nown-linux-gnu/lib/rustlib/src/rust/library/proc_macro/src/bridge/mod.rs","= range":{"start":{"line":421,"character":0},"end":{"line":426,"character":2}= }},{"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux= -gnu/lib/rustlib/src/rust/library/proc_macro/src/bridge/mod.rs","range":{"s= tart":{"line":421,"character":0},"end":{"line":426,"character":2}}},{"uri":= "file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/r= ustlib/src/rust/library/proc_macro/src/bridge/mod.rs","range":{"start":{"li= ne":421,"character":0},"end":{"line":426,"character":2}}},{"uri":"file:///h= ome/dick/.cargo/registry/src/github.com-1ecc6299db9ec823/anyhow-1.0.32/src/= context.rs","range":{"start":{"line":175,"character":4},"end":{"line":175,"= character":35}}},{"uri":"file:///home/dick/.cargo/registry/src/github.com-1= ecc6299db9ec823/anyhow-1.0.32/src/context.rs","range":{"start":{"line":61,"= character":0},"end":{"line":96,"character":1}}},{"uri":"file:///home/dick/.= cargo/registry/src/github.com-1ecc6299db9ec823/arc-swap-0.4.7/src/ref_cnt.r= s","range":{"start":{"line":112,"character":0},"end":{"line":127,"character= ":1}}},{"uri":"file:///home/dick/.cargo/registry/src/github.com-1ecc6299db9= ec823/futures-0.1.29/src/future/option.rs","range":{"start":{"line":4,"char= acter":0},"end":{"line":14,"character":1}}},{"uri":"file:///home/dick/.carg= o/registry/src/github.com-1ecc6299db9ec823/jsonrpc-core-15.1.0/src/calls.rs= ","range":{"start":{"line":9,"character":0},"end":{"line":9,"character":43}= }},{"uri":"file:///home/dick/.cargo/registry/src/github.com-1ecc6299db9ec82= 3/jsonrpc-core-15.1.0/src/io.rs","range":{"start":{"line":380,"character":0= },"end":{"line":386,"character":1}}},{"uri":"file:///home/dick/.cargo/regis= try/src/github.com-1ecc6299db9ec823/parking_lot-0.10.2/src/util.rs","range"= :{"start":{"line":14,"character":0},"end":{"line":22,"character":1}}},{"uri= ":"file:///home/dick/.cargo/registry/src/github.com-1ecc6299db9ec823/parkin= g_lot_core-0.7.2/src/util.rs","range":{"start":{"line":12,"character":0},"e= nd":{"line":20,"character":1}}},{"uri":"file:///home/dick/.cargo/registry/s= rc/github.com-1ecc6299db9ec823/quote-1.0.7/src/to_tokens.rs","range":{"star= t":{"line":108,"character":0},"end":{"line":114,"character":1}}},{"uri":"fi= le:///home/dick/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.1= 14/src/de/impls.rs","range":{"start":{"line":635,"character":0},"end":{"lin= e":653,"character":1}}},{"uri":"file:///home/dick/.cargo/registry/src/githu= b.com-1ecc6299db9ec823/serde-1.0.114/src/ser/impls.rs","range":{"start":{"l= ine":98,"character":0},"end":{"line":112,"character":1}}},{"uri":"file:///h= ome/dick/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.35/src/exp= r.rs","range":{"start":{"line":2463,"character":4},"end":{"line":2472,"char= acter":5}}},{"uri":"file:///home/dick/.cargo/registry/src/github.com-1ecc62= 99db9ec823/syn-1.0.35/src/generics.rs","range":{"start":{"line":647,"charac= ter":4},"end":{"line":655,"character":5}}},{"uri":"file:///home/dick/.cargo= /registry/src/github.com-1ecc6299db9ec823/syn-1.0.35/src/generics.rs","rang= e":{"start":{"line":811,"character":4},"end":{"line":819,"character":5}}},{= "uri":"file:///home/dick/.cargo/registry/src/github.com-1ecc6299db9ec823/sy= n-1.0.35/src/ty.rs","range":{"start":{"line":1057,"character":4},"end":{"li= ne":1065,"character":5}}},{"uri":"file:///home/dick/.cargo/registry/src/git= hub.com-1ecc6299db9ec823/syn-1.0.35/src/parse.rs","range":{"start":{"line":= 1037,"character":0},"end":{"line":1045,"character":1}}}]]},"data":{"impls":= {"textDocument":{"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-= unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"},"positi= on":{"line":517,"character":9}}}}} 17:00:16 DEBUG writer-Some("rust") src/rpcclient.rs:254 =3D> Some("rust") {= "jsonrpc":"2.0","method":"codeLens/resolve","params":{"data":{"impls":{"pos= ition":{"character":7,"line":2037},"textDocument":{"uri":"file:///home/dick= /.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/li= brary/core/src/option.rs"}}},"range":{"end":{"character":11,"line":2037},"s= tart":{"character":7,"line":2037}}},"id":5} 17:00:16 DEBUG reader-Some("rust") src/rpcclient.rs:207 <=3D Some("rust") {= "jsonrpc":"2.0","id":5,"result":{"range":{"start":{"line":2037,"character":= 7},"end":{"line":2037,"character":11}},"command":{"title":"7 implementation= s","command":"rust-analyzer.showReferences","arguments":["file:///home/dick= /.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/li= brary/core/src/option.rs",{"line":2037,"character":7},[{"uri":"file:///home= /dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/ru= st/library/core/src/option.rs","range":{"start":{"line":2036,"character":0}= ,"end":{"line":2036,"character":23}}},{"uri":"file:///home/dick/.rustup/too= lchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/s= rc/option.rs","range":{"start":{"line":2041,"character":0},"end":{"line":20= 56,"character":1}}},{"uri":"file:///home/dick/.rustup/toolchains/stable-x86= _64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs","ran= ge":{"start":{"line":2067,"character":0},"end":{"line":2067,"character":40}= }},{"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux= -gnu/lib/rustlib/src/rust/library/core/src/option.rs","range":{"start":{"li= ne":2036,"character":0},"end":{"line":2036,"character":23}}},{"uri":"file:/= //home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/= src/rust/library/core/src/option.rs","range":{"start":{"line":2065,"charact= er":0},"end":{"line":2065,"character":40}}},{"uri":"file:///home/dick/.rust= up/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/= core/src/option.rs","range":{"start":{"line":2066,"character":0},"end":{"li= ne":2066,"character":36}}},{"uri":"file:///home/dick/.rustup/toolchains/sta= ble-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.r= s","range":{"start":{"line":2058,"character":0},"end":{"line":2063,"charact= er":1}}}]]},"data":{"impls":{"textDocument":{"uri":"file:///home/dick/.rust= up/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/= core/src/option.rs"},"position":{"line":2037,"character":7}}}}} 17:00:16 DEBUG writer-Some("rust") src/rpcclient.rs:254 =3D> Some("rust") {= "jsonrpc":"2.0","method":"codeLens/resolve","params":{"data":{"impls":{"pos= ition":{"character":11,"line":2076},"textDocument":{"uri":"file:///home/dic= k/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/l= ibrary/core/src/option.rs"}}},"range":{"end":{"character":15,"line":2076},"= start":{"character":11,"line":2076}}},"id":6} 17:00:16 DEBUG reader-Some("rust") src/rpcclient.rs:207 <=3D Some("rust") {= "jsonrpc":"2.0","id":6,"result":{"range":{"start":{"line":2076,"character":= 11},"end":{"line":2076,"character":15}},"command":{"title":"8 implementatio= ns","command":"rust-analyzer.showReferences","arguments":["file:///home/dic= k/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/l= ibrary/core/src/option.rs",{"line":2076,"character":11},[{"uri":"file:///ho= me/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/= rust/library/core/src/option.rs","range":{"start":{"line":2075,"character":= 0},"end":{"line":2075,"character":16}}},{"uri":"file:///home/dick/.rustup/t= oolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core= /src/option.rs","range":{"start":{"line":2080,"character":0},"end":{"line":= 2092,"character":1}}},{"uri":"file:///home/dick/.rustup/toolchains/stable-x= 86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs","r= ange":{"start":{"line":2108,"character":0},"end":{"line":2109,"character":4= 4}}},{"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-lin= ux-gnu/lib/rustlib/src/rust/library/core/src/option.rs","range":{"start":{"= line":2111,"character":0},"end":{"line":2117,"character":1}}},{"uri":"file:= ///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib= /src/rust/library/core/src/option.rs","range":{"start":{"line":2102,"charac= ter":0},"end":{"line":2103,"character":44}}},{"uri":"file:///home/dick/.rus= tup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library= /core/src/option.rs","range":{"start":{"line":2105,"character":0},"end":{"l= ine":2106,"character":40}}},{"uri":"file:///home/dick/.rustup/toolchains/st= able-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.= rs","range":{"start":{"line":2094,"character":0},"end":{"line":2100,"charac= ter":1}}},{"uri":"file:///home/dick/.cargo/registry/src/github.com-1ecc6299= db9ec823/itertools-0.9.0/src/peeking_take_while.rs","range":{"start":{"line= ":137,"character":0},"end":{"line":137,"character":61}}}]]},"data":{"impls"= :{"textDocument":{"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64= -unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"},"posit= ion":{"line":2076,"character":11}}}}} 17:00:16 DEBUG writer-Some("rust") src/rpcclient.rs:254 =3D> Some("rust") {= "jsonrpc":"2.0","method":"codeLens/resolve","params":{"data":{"impls":{"pos= ition":{"character":11,"line":2126},"textDocument":{"uri":"file:///home/dic= k/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/l= ibrary/core/src/option.rs"}}},"range":{"end":{"character":18,"line":2126},"= start":{"character":11,"line":2126}}},"id":7} 17:00:16 DEBUG reader-Some("rust") src/rpcclient.rs:207 <=3D Some("rust") {= "jsonrpc":"2.0","id":7,"result":{"range":{"start":{"line":2126,"character":= 11},"end":{"line":2126,"character":18}},"command":{"title":"6 implementatio= ns","command":"rust-analyzer.showReferences","arguments":["file:///home/dic= k/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/l= ibrary/core/src/option.rs",{"line":2126,"character":11},[{"uri":"file:///ho= me/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/= rust/library/core/src/option.rs","range":{"start":{"line":2125,"character":= 0},"end":{"line":2125,"character":16}}},{"uri":"file:///home/dick/.rustup/t= oolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core= /src/option.rs","range":{"start":{"line":2130,"character":0},"end":{"line":= 2142,"character":1}}},{"uri":"file:///home/dick/.rustup/toolchains/stable-x= 86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs","r= ange":{"start":{"line":2157,"character":0},"end":{"line":2158,"character":4= 7}}},{"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-lin= ux-gnu/lib/rustlib/src/rust/library/core/src/option.rs","range":{"start":{"= line":2152,"character":0},"end":{"line":2153,"character":47}}},{"uri":"file= :///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustli= b/src/rust/library/core/src/option.rs","range":{"start":{"line":2155,"chara= cter":0},"end":{"line":2156,"character":43}}},{"uri":"file:///home/dick/.ru= stup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/librar= y/core/src/option.rs","range":{"start":{"line":2144,"character":0},"end":{"= line":2150,"character":1}}}]]},"data":{"impls":{"textDocument":{"uri":"file= :///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustli= b/src/rust/library/core/src/option.rs"},"position":{"line":2126,"character"= :11}}}}} 17:00:16 DEBUG writer-Some("rust") src/rpcclient.rs:254 =3D> Some("rust") {= "jsonrpc":"2.0","method":"codeLens/resolve","params":{"data":{"impls":{"pos= ition":{"character":11,"line":2167},"textDocument":{"uri":"file:///home/dic= k/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/l= ibrary/core/src/option.rs"}}},"range":{"end":{"character":19,"line":2167},"= start":{"character":11,"line":2167}}},"id":8} 17:00:16 DEBUG reader-Some("rust") src/rpcclient.rs:207 <=3D Some("rust") {= "jsonrpc":"2.0","id":8,"result":{"range":{"start":{"line":2167,"character":= 11},"end":{"line":2167,"character":19}},"command":{"title":"7 implementatio= ns","command":"rust-analyzer.showReferences","arguments":["file:///home/dic= k/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/l= ibrary/core/src/option.rs",{"line":2167,"character":11},[{"uri":"file:///ho= me/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/= rust/library/core/src/option.rs","range":{"start":{"line":2165,"character":= 0},"end":{"line":2165,"character":23}}},{"uri":"file:///home/dick/.rustup/t= oolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core= /src/option.rs","range":{"start":{"line":2171,"character":0},"end":{"line":= 2183,"character":1}}},{"uri":"file:///home/dick/.rustup/toolchains/stable-x= 86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs","r= ange":{"start":{"line":2199,"character":0},"end":{"line":2200,"character":4= 4}}},{"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-lin= ux-gnu/lib/rustlib/src/rust/library/core/src/option.rs","range":{"start":{"= line":2165,"character":0},"end":{"line":2165,"character":23}}},{"uri":"file= :///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustli= b/src/rust/library/core/src/option.rs","range":{"start":{"line":2193,"chara= cter":0},"end":{"line":2194,"character":44}}},{"uri":"file:///home/dick/.ru= stup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/librar= y/core/src/option.rs","range":{"start":{"line":2196,"character":0},"end":{"= line":2197,"character":40}}},{"uri":"file:///home/dick/.rustup/toolchains/s= table-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option= .rs","range":{"start":{"line":2185,"character":0},"end":{"line":2191,"chara= cter":1}}}]]},"data":{"impls":{"textDocument":{"uri":"file:///home/dick/.ru= stup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/librar= y/core/src/option.rs"},"position":{"line":2167,"character":11}}}}} 17:00:16 DEBUG unnamed src/language_client.rs:108 state.code_lens./home/dic= k/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/l= ibrary/core/src/option.rs: null =3D=3D> [{"command":{"arguments":[{"args":{= "cargoArgs":["test","--doc"],"cargoExtraArgs":[],"executableArgs":["option:= :Option::is_some","--nocapture"],"overrideCargo":null},"kind":"cargo","l= abel":"doctest option::Option::is_some","location":{"targetRange":{"end"= :{"character":5,"line":554},"start":{"character":4,"line":537}},"targetSele= ctionRange":{"end":{"character":5,"line":554},"start":{"character":4,"line"= :537}},"targetUri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unkn= own-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"}}],"command"= :"rust-analyzer.runSingle","title":"=E2=96=B6=EF=B8=8E Run Doctest"},"range= ":{"end":{"character":5,"line":554},"start":{"character":4,"line":537}}},{"= command":{"arguments":[{"args":{"cargoArgs":["test","--doc"],"cargoExtraArg= s":[],"executableArgs":["option::Option::is_some_and","--nocapture"],"ov= errideCargo":null},"kind":"cargo","label":"doctest option::Option::is_so= me_and","location":{"targetRange":{"end":{"character":5,"line":577},"start"= :{"character":4,"line":556}},"targetSelectionRange":{"end":{"character":5,"= line":577},"start":{"character":4,"line":556}},"targetUri":"file:///home/di= ck/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/= library/core/src/option.rs"}}],"command":"rust-analyzer.runSingle","title":= "=E2=96=B6=EF=B8=8E Run Doctest"},"range":{"end":{"character":5,"line":577}= ,"start":{"character":4,"line":556}}},{"command":{"arguments":[{"args":{"ca= rgoArgs":["test","--doc"],"cargoExtraArgs":[],"executableArgs":["option::Op= tion::is_none","--nocapture"],"overrideCargo":null},"kind":"cargo","labe= l":"doctest option::Option::is_none","location":{"targetRange":{"end":{"= character":5,"line":597},"start":{"character":4,"line":579}},"targetSelecti= onRange":{"end":{"character":5,"line":597},"start":{"character":4,"line":57= 9}},"targetUri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown= -linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"}}],"command":"r= ust-analyzer.runSingle","title":"=E2=96=B6=EF=B8=8E Run Doctest"},"range":{= "end":{"character":5,"line":597},"start":{"character":4,"line":579}}},{"com= mand":{"arguments":[{"args":{"cargoArgs":["test","--doc"],"cargoExtraArgs":= [],"executableArgs":["option::Option::as_ref","--nocapture"],"overrideCa= rgo":null},"kind":"cargo","label":"doctest option::Option::as_ref","loca= tion":{"targetRange":{"end":{"character":5,"line":630},"start":{"character"= :4,"line":603}},"targetSelectionRange":{"end":{"character":5,"line":630},"s= tart":{"character":4,"line":603}},"targetUri":"file:///home/dick/.rustup/to= olchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/= src/option.rs"}}],"command":"rust-analyzer.runSingle","title":"=E2=96=B6=EF= =B8=8E Run Doctest"},"range":{"end":{"character":5,"line":630},"start":{"ch= aracter":4,"line":603}}},{"command":{"arguments":[{"args":{"cargoArgs":["te= st","--doc"],"cargoExtraArgs":[],"executableArgs":["option::Option::as_m= ut","--nocapture"],"overrideCargo":null},"kind":"cargo","label":"doctest op= tion::Option::as_mut","location":{"targetRange":{"end":{"character":5,"l= ine":652},"start":{"character":4,"line":632}},"targetSelectionRange":{"end"= :{"character":5,"line":652},"start":{"character":4,"line":632}},"targetUri"= :"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/= rustlib/src/rust/library/core/src/option.rs"}}],"command":"rust-analyzer.ru= nSingle","title":"=E2=96=B6=EF=B8=8E Run Doctest"},"range":{"end":{"charact= er":5,"line":652},"start":{"character":4,"line":632}}},{"command":{"argumen= ts":[{"args":{"cargoArgs":["test","--doc"],"cargoExtraArgs":[],"executableA= rgs":["option::Option::expect","--nocapture"],"overrideCargo":null},"kin= d":"cargo","label":"doctest option::Option::expect","location":{"targetR= ange":{"end":{"character":5,"line":739},"start":{"character":4,"line":692}}= ,"targetSelectionRange":{"end":{"character":5,"line":739},"start":{"charact= er":4,"line":692}},"targetUri":"file:///home/dick/.rustup/toolchains/stable= -x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"}= }],"command":"rust-analyzer.runSingle","title":"=E2=96=B6=EF=B8=8E Run Doct= est"},"range":{"end":{"character":5,"line":739},"start":{"character":4,"lin= e":692}}},{"command":{"arguments":[{"args":{"cargoArgs":["test","--doc"],"c= argoExtraArgs":[],"executableArgs":["option::Option::unwrap","--nocaptur= e"],"overrideCargo":null},"kind":"cargo","label":"doctest option::Option= ::unwrap","location":{"targetRange":{"end":{"character":5,"line":776},"star= t":{"character":4,"line":741}},"targetSelectionRange":{"end":{"character":5= ,"line":776},"start":{"character":4,"line":741}},"targetUri":"file:///home/= dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rus= t/library/core/src/option.rs"}}],"command":"rust-analyzer.runSingle","title= ":"=E2=96=B6=EF=B8=8E Run Doctest"},"range":{"end":{"character":5,"line":77= 6},"start":{"character":4,"line":741}}},{"command":{"arguments":[{"args":{"= cargoArgs":["test","--doc"],"cargoExtraArgs":[],"executableArgs":["option::= Option::unwrap_or","--nocapture"],"overrideCargo":null},"kind":"cargo","= label":"doctest option::Option::unwrap_or","location":{"targetRange":{"e= nd":{"character":5,"line":803},"start":{"character":4,"line":778}},"targetS= electionRange":{"end":{"character":5,"line":803},"start":{"character":4,"li= ne":778}},"targetUri":"file:///home/dick/.rustup/toolchains/stable-x86_64-u= nknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"}}],"comma= nd":"rust-analyzer.runSingle","title":"=E2=96=B6=EF=B8=8E Run Doctest"},"ra= nge":{"end":{"character":5,"line":803},"start":{"character":4,"line":778}}}= ,{"command":{"arguments":[{"args":{"cargoArgs":["test","--doc"],"cargoExtra= Args":[],"executableArgs":["option::Option::unwrap_or_else","--nocapture= "],"overrideCargo":null},"kind":"cargo","label":"doctest option::Option:= :unwrap_or_else","location":{"targetRange":{"end":{"character":5,"line":826= },"start":{"character":4,"line":805}},"targetSelectionRange":{"end":{"chara= cter":5,"line":826},"start":{"character":4,"line":805}},"targetUri":"file:/= //home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/= src/rust/library/core/src/option.rs"}}],"command":"rust-analyzer.runSingle"= ,"title":"=E2=96=B6=EF=B8=8E Run Doctest"},"range":{"end":{"character":5,"l= ine":826},"start":{"character":4,"line":805}}},{"command":{"arguments":[{"a= rgs":{"cargoArgs":["test","--doc"],"cargoExtraArgs":[],"executableArgs":["o= ption::Option::unwrap_or_default","--nocapture"],"overrideCargo":null},"= kind":"cargo","label":"doctest option::Option::unwrap_or_default","locat= ion":{"targetRange":{"end":{"character":5,"line":865},"start":{"character":= 4,"line":828}},"targetSelectionRange":{"end":{"character":5,"line":865},"st= art":{"character":4,"line":828}},"targetUri":"file:///home/dick/.rustup/too= lchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/s= rc/option.rs"}}],"command":"rust-analyzer.runSingle","title":"=E2=96=B6=EF= =B8=8E Run Doctest"},"range":{"end":{"character":5,"line":865},"start":{"ch= aracter":4,"line":828}}},{"command":{"arguments":[{"args":{"cargoArgs":["te= st","--doc"],"cargoExtraArgs":[],"executableArgs":["option::Option::unwr= ap_unchecked","--nocapture"],"overrideCargo":null},"kind":"cargo","label":"= doctest option::Option::unwrap_unchecked","location":{"targetRange":{"en= d":{"character":5,"line":898},"start":{"character":4,"line":867}},"targetSe= lectionRange":{"end":{"character":5,"line":898},"start":{"character":4,"lin= e":867}},"targetUri":"file:///home/dick/.rustup/toolchains/stable-x86_64-un= known-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"}}],"comman= d":"rust-analyzer.runSingle","title":"=E2=96=B6=EF=B8=8E Run Doctest"},"ran= ge":{"end":{"character":5,"line":898},"start":{"character":4,"line":867}}},= {"command":{"arguments":[{"args":{"cargoArgs":["test","--doc"],"cargoExtraA= rgs":[],"executableArgs":["option::Option::map","--nocapture"],"override= Cargo":null},"kind":"cargo","label":"doctest option::Option::map","locat= ion":{"targetRange":{"end":{"character":5,"line":931},"start":{"character":= 4,"line":904}},"targetSelectionRange":{"end":{"character":5,"line":931},"st= art":{"character":4,"line":904}},"targetUri":"file:///home/dick/.rustup/too= lchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/s= rc/option.rs"}}],"command":"rust-analyzer.runSingle","title":"=E2=96=B6=EF= =B8=8E Run Doctest"},"range":{"end":{"character":5,"line":931},"start":{"ch= aracter":4,"line":904}}},{"command":{"arguments":[{"args":{"cargoArgs":["te= st","--doc"],"cargoExtraArgs":[],"executableArgs":["option::Option::insp= ect","--nocapture"],"overrideCargo":null},"kind":"cargo","label":"doctest o= ption::Option::inspect","location":{"targetRange":{"end":{"character":5,= "line":961},"start":{"character":4,"line":933}},"targetSelectionRange":{"en= d":{"character":5,"line":961},"start":{"character":4,"line":933}},"targetUr= i":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/li= b/rustlib/src/rust/library/core/src/option.rs"}}],"command":"rust-analyzer.= runSingle","title":"=E2=96=B6=EF=B8=8E Run Doctest"},"range":{"end":{"chara= cter":5,"line":961},"start":{"character":4,"line":933}}},{"command":{"argum= ents":[{"args":{"cargoArgs":["test","--doc"],"cargoExtraArgs":[],"executabl= eArgs":["option::Option::map_or","--nocapture"],"overrideCargo":null},"k= ind":"cargo","label":"doctest option::Option::map_or","location":{"targe= tRange":{"end":{"character":5,"line":994},"start":{"character":4,"line":963= }},"targetSelectionRange":{"end":{"character":5,"line":994},"start":{"chara= cter":4,"line":963}},"targetUri":"file:///home/dick/.rustup/toolchains/stab= le-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs= "}}],"command":"rust-analyzer.runSingle","title":"=E2=96=B6=EF=B8=8E Run Do= ctest"},"range":{"end":{"character":5,"line":994},"start":{"character":4,"l= ine":963}}},{"command":{"arguments":[{"args":{"cargoArgs":["test","--doc"],= "cargoExtraArgs":[],"executableArgs":["option::Option::map_or_else","--n= ocapture"],"overrideCargo":null},"kind":"cargo","label":"doctest option::Op= tion::map_or_else","location":{"targetRange":{"end":{"character":5,"line= ":1024},"start":{"character":4,"line":996}},"targetSelectionRange":{"end":{= "character":5,"line":1024},"start":{"character":4,"line":996}},"targetUri":= "file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/r= ustlib/src/rust/library/core/src/option.rs"}}],"command":"rust-analyzer.run= Single","title":"=E2=96=B6=EF=B8=8E Run Doctest"},"range":{"end":{"characte= r":5,"line":1024},"start":{"character":4,"line":996}}},{"command":{"argumen= ts":[{"args":{"cargoArgs":["test","--doc"],"cargoExtraArgs":[],"executableA= rgs":["option::Option::ok_or","--nocapture"],"overrideCargo":null},"kind= ":"cargo","label":"doctest option::Option::ok_or","location":{"targetRan= ge":{"end":{"character":5,"line":1058},"start":{"character":4,"line":1026}}= ,"targetSelectionRange":{"end":{"character":5,"line":1058},"start":{"charac= ter":4,"line":1026}},"targetUri":"file:///home/dick/.rustup/toolchains/stab= le-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs= "}}],"command":"rust-analyzer.runSingle","title":"=E2=96=B6=EF=B8=8E Run Do= ctest"},"range":{"end":{"character":5,"line":1058},"start":{"character":4,"= line":1026}}},{"command":{"arguments":[{"args":{"cargoArgs":["test","--doc"= ],"cargoExtraArgs":[],"executableArgs":["option::Option::ok_or_else","--= nocapture"],"overrideCargo":null},"kind":"cargo","label":"doctest option::O= ption::ok_or_else","location":{"targetRange":{"end":{"character":5,"line= ":1088},"start":{"character":4,"line":1060}},"targetSelectionRange":{"end":= {"character":5,"line":1088},"start":{"character":4,"line":1060}},"targetUri= ":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib= /rustlib/src/rust/library/core/src/option.rs"}}],"command":"rust-analyzer.r= unSingle","title":"=E2=96=B6=EF=B8=8E Run Doctest"},"range":{"end":{"charac= ter":5,"line":1088},"start":{"character":4,"line":1060}}},{"command":{"argu= ments":[{"args":{"cargoArgs":["test","--doc"],"cargoExtraArgs":[],"executab= leArgs":["option::Option::as_deref","--nocapture"],"overrideCargo":null}= ,"kind":"cargo","label":"doctest option::Option::as_deref","location":{"= targetRange":{"end":{"character":5,"line":1114},"start":{"character":4,"lin= e":1090}},"targetSelectionRange":{"end":{"character":5,"line":1114},"start"= :{"character":4,"line":1090}},"targetUri":"file:///home/dick/.rustup/toolch= ains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/= option.rs"}}],"command":"rust-analyzer.runSingle","title":"=E2=96=B6=EF=B8= =8E Run Doctest"},"range":{"end":{"character":5,"line":1114},"start":{"char= acter":4,"line":1090}}},{"command":{"arguments":[{"args":{"cargoArgs":["tes= t","--doc"],"cargoExtraArgs":[],"executableArgs":["option::Option::as_de= ref_mut","--nocapture"],"overrideCargo":null},"kind":"cargo","label":"docte= st option::Option::as_deref_mut","location":{"targetRange":{"end":{"char= acter":5,"line":1140},"start":{"character":4,"line":1116}},"targetSelection= Range":{"end":{"character":5,"line":1140},"start":{"character":4,"line":111= 6}},"targetUri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown= -linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"}}],"command":"r= ust-analyzer.runSingle","title":"=E2=96=B6=EF=B8=8E Run Doctest"},"range":{= "end":{"character":5,"line":1140},"start":{"character":4,"line":1116}}},{"c= ommand":{"arguments":[{"args":{"cargoArgs":["test","--doc"],"cargoExtraArgs= ":[],"executableArgs":["option::Option::iter","--nocapture"],"overrideCa= rgo":null},"kind":"cargo","label":"doctest option::Option::iter","locati= on":{"targetRange":{"end":{"character":5,"line":1162},"start":{"character":= 4,"line":1146}},"targetSelectionRange":{"end":{"character":5,"line":1162},"= start":{"character":4,"line":1146}},"targetUri":"file:///home/dick/.rustup/= toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/cor= e/src/option.rs"}}],"command":"rust-analyzer.runSingle","title":"=E2=96=B6= =EF=B8=8E Run Doctest"},"range":{"end":{"character":5,"line":1162},"start":= {"character":4,"line":1146}}},{"command":{"arguments":[{"args":{"cargoArgs"= :["test","--doc"],"cargoExtraArgs":[],"executableArgs":["option::Option:= :iter_mut","--nocapture"],"overrideCargo":null},"kind":"cargo","label":"doc= test option::Option::iter_mut","location":{"targetRange":{"end":{"charac= ter":5,"line":1183},"start":{"character":4,"line":1164}},"targetSelectionRa= nge":{"end":{"character":5,"line":1183},"start":{"character":4,"line":1164}= },"targetUri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-l= inux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"}}],"command":"rus= t-analyzer.runSingle","title":"=E2=96=B6=EF=B8=8E Run Doctest"},"range":{"e= nd":{"character":5,"line":1183},"start":{"character":4,"line":1164}}},{"com= mand":{"arguments":[{"args":{"cargoArgs":["test","--doc"],"cargoExtraArgs":= [],"executableArgs":["option::Option::and","--nocapture"],"overrideCargo= ":null},"kind":"cargo","label":"doctest option::Option::and","location":= {"targetRange":{"end":{"character":5,"line":1222},"start":{"character":4,"l= ine":1189}},"targetSelectionRange":{"end":{"character":5,"line":1222},"star= t":{"character":4,"line":1189}},"targetUri":"file:///home/dick/.rustup/tool= chains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/sr= c/option.rs"}}],"command":"rust-analyzer.runSingle","title":"=E2=96=B6=EF= =B8=8E Run Doctest"},"range":{"end":{"character":5,"line":1222},"start":{"c= haracter":4,"line":1189}}},{"command":{"arguments":[{"args":{"cargoArgs":["= test","--doc"],"cargoExtraArgs":[],"executableArgs":["option::Option::an= d_then","--nocapture"],"overrideCargo":null},"kind":"cargo","label":"doctes= t option::Option::and_then","location":{"targetRange":{"end":{"character= ":5,"line":1264},"start":{"character":4,"line":1224}},"targetSelectionRange= ":{"end":{"character":5,"line":1264},"start":{"character":4,"line":1224}},"= targetUri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linu= x-gnu/lib/rustlib/src/rust/library/core/src/option.rs"}}],"command":"rust-a= nalyzer.runSingle","title":"=E2=96=B6=EF=B8=8E Run Doctest"},"range":{"end"= :{"character":5,"line":1264},"start":{"character":4,"line":1224}}},{"comman= d":{"arguments":[{"args":{"cargoArgs":["test","--doc"],"cargoExtraArgs":[],= "executableArgs":["option::Option::filter","--nocapture"],"overrideCargo= ":null},"kind":"cargo","label":"doctest option::Option::filter","locatio= n":{"targetRange":{"end":{"character":5,"line":1305},"start":{"character":4= ,"line":1266}},"targetSelectionRange":{"end":{"character":5,"line":1305},"s= tart":{"character":4,"line":1266}},"targetUri":"file:///home/dick/.rustup/t= oolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core= /src/option.rs"}}],"command":"rust-analyzer.runSingle","title":"=E2=96=B6= =EF=B8=8E Run Doctest"},"range":{"end":{"character":5,"line":1305},"start":= {"character":4,"line":1266}}},{"command":{"arguments":[{"args":{"cargoArgs"= :["test","--doc"],"cargoExtraArgs":[],"executableArgs":["option::Option:= :or","--nocapture"],"overrideCargo":null},"kind":"cargo","label":"doctest o= ption::Option::or","location":{"targetRange":{"end":{"character":5,"line= ":1345},"start":{"character":4,"line":1307}},"targetSelectionRange":{"end":= {"character":5,"line":1345},"start":{"character":4,"line":1307}},"targetUri= ":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib= /rustlib/src/rust/library/core/src/option.rs"}}],"command":"rust-analyzer.r= unSingle","title":"=E2=96=B6=EF=B8=8E Run Doctest"},"range":{"end":{"charac= ter":5,"line":1345},"start":{"character":4,"line":1307}}},{"command":{"argu= ments":[{"args":{"cargoArgs":["test","--doc"],"cargoExtraArgs":[],"executab= leArgs":["option::Option::or_else","--nocapture"],"overrideCargo":null},= "kind":"cargo","label":"doctest option::Option::or_else","location":{"ta= rgetRange":{"end":{"character":5,"line":1372},"start":{"character":4,"line"= :1347}},"targetSelectionRange":{"end":{"character":5,"line":1372},"start":{= "character":4,"line":1347}},"targetUri":"file:///home/dick/.rustup/toolchai= ns/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/op= tion.rs"}}],"command":"rust-analyzer.runSingle","title":"=E2=96=B6=EF=B8=8E= Run Doctest"},"range":{"end":{"character":5,"line":1372},"start":{"charact= er":4,"line":1347}}},{"command":{"arguments":[{"args":{"cargoArgs":["test",= "--doc"],"cargoExtraArgs":[],"executableArgs":["option::Option::xor","--= nocapture"],"overrideCargo":null},"kind":"cargo","label":"doctest option::O= ption::xor","location":{"targetRange":{"end":{"character":5,"line":1407}= ,"start":{"character":4,"line":1374}},"targetSelectionRange":{"end":{"chara= cter":5,"line":1407},"start":{"character":4,"line":1374}},"targetUri":"file= :///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustli= b/src/rust/library/core/src/option.rs"}}],"command":"rust-analyzer.runSingl= e","title":"=E2=96=B6=EF=B8=8E Run Doctest"},"range":{"end":{"character":5,= "line":1407},"start":{"character":4,"line":1374}}},{"command":{"arguments":= [{"args":{"cargoArgs":["test","--doc"],"cargoExtraArgs":[],"executableArgs"= :["option::Option::insert","--nocapture"],"overrideCargo":null},"kind":"= cargo","label":"doctest option::Option::insert","location":{"targetRange= ":{"end":{"character":5,"line":1444},"start":{"character":4,"line":1413}},"= targetSelectionRange":{"end":{"character":5,"line":1444},"start":{"characte= r":4,"line":1413}},"targetUri":"file:///home/dick/.rustup/toolchains/stable= -x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"}= }],"command":"rust-analyzer.runSingle","title":"=E2=96=B6=EF=B8=8E Run Doct= est"},"range":{"end":{"character":5,"line":1444},"start":{"character":4,"li= ne":1413}}},{"command":{"arguments":[{"args":{"cargoArgs":["test","--doc"],= "cargoExtraArgs":[],"executableArgs":["option::Option::get_or_insert","-= -nocapture"],"overrideCargo":null},"kind":"cargo","label":"doctest option::= Option::get_or_insert","location":{"targetRange":{"end":{"character":5,"= line":1480},"start":{"character":4,"line":1446}},"targetSelectionRange":{"e= nd":{"character":5,"line":1480},"start":{"character":4,"line":1446}},"targe= tUri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu= /lib/rustlib/src/rust/library/core/src/option.rs"}}],"command":"rust-analyz= er.runSingle","title":"=E2=96=B6=EF=B8=8E Run Doctest"},"range":{"end":{"ch= aracter":5,"line":1480},"start":{"character":4,"line":1446}}},{"command":{"= arguments":[{"args":{"cargoArgs":["test","--doc"],"cargoExtraArgs":[],"exec= utableArgs":["option::Option::get_or_insert_default","--nocapture"],"ove= rrideCargo":null},"kind":"cargo","label":"doctest option::Option::get_or= _insert_default","location":{"targetRange":{"end":{"character":5,"line":151= 3},"start":{"character":4,"line":1482}},"targetSelectionRange":{"end":{"cha= racter":5,"line":1513},"start":{"character":4,"line":1482}},"targetUri":"fi= le:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rust= lib/src/rust/library/core/src/option.rs"}}],"command":"rust-analyzer.runSin= gle","title":"=E2=96=B6=EF=B8=8E Run Doctest"},"range":{"end":{"character":= 5,"line":1513},"start":{"character":4,"line":1482}}},{"command":{"arguments= ":[{"args":{"cargoArgs":["test","--doc"],"cargoExtraArgs":[],"executableArg= s":["option::Option::get_or_insert_with","--nocapture"],"overrideCargo":= null},"kind":"cargo","label":"doctest option::Option::get_or_insert_with= ","location":{"targetRange":{"end":{"character":5,"line":1549},"start":{"ch= aracter":4,"line":1515}},"targetSelectionRange":{"end":{"character":5,"line= ":1549},"start":{"character":4,"line":1515}},"targetUri":"file:///home/dick= /.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/li= brary/core/src/option.rs"}}],"command":"rust-analyzer.runSingle","title":"= =E2=96=B6=EF=B8=8E Run Doctest"},"range":{"end":{"character":5,"line":1549}= ,"start":{"character":4,"line":1515}}},{"command":{"arguments":[{"args":{"c= argoArgs":["test","--doc"],"cargoExtraArgs":[],"executableArgs":["option::O= ption::take","--nocapture"],"overrideCargo":null},"kind":"cargo","label"= :"doctest option::Option::take","location":{"targetRange":{"end":{"chara= cter":5,"line":1576},"start":{"character":4,"line":1555}},"targetSelectionR= ange":{"end":{"character":5,"line":1576},"start":{"character":4,"line":1555= }},"targetUri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-= linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"}}],"command":"ru= st-analyzer.runSingle","title":"=E2=96=B6=EF=B8=8E Run Doctest"},"range":{"= end":{"character":5,"line":1576},"start":{"character":4,"line":1555}}},{"co= mmand":{"arguments":[{"args":{"cargoArgs":["test","--doc"],"cargoExtraArgs"= :[],"executableArgs":["option::Option::replace","--nocapture"],"override= Cargo":null},"kind":"cargo","label":"doctest option::Option::replace","l= ocation":{"targetRange":{"end":{"character":5,"line":1600},"start":{"charac= ter":4,"line":1578}},"targetSelectionRange":{"end":{"character":5,"line":16= 00},"start":{"character":4,"line":1578}},"targetUri":"file:///home/dick/.ru= stup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/librar= y/core/src/option.rs"}}],"command":"rust-analyzer.runSingle","title":"=E2= =96=B6=EF=B8=8E Run Doctest"},"range":{"end":{"character":5,"line":1600},"s= tart":{"character":4,"line":1578}}},{"command":{"arguments":[{"args":{"carg= oArgs":["test","--doc"],"cargoExtraArgs":[],"executableArgs":["option::Opti= on::contains","--nocapture"],"overrideCargo":null},"kind":"cargo","label= ":"doctest option::Option::contains","location":{"targetRange":{"end":{"= character":5,"line":1630},"start":{"character":4,"line":1602}},"targetSelec= tionRange":{"end":{"character":5,"line":1630},"start":{"character":4,"line"= :1602}},"targetUri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unk= nown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"}}],"command= ":"rust-analyzer.runSingle","title":"=E2=96=B6=EF=B8=8E Run Doctest"},"rang= e":{"end":{"character":5,"line":1630},"start":{"character":4,"line":1602}}}= ,{"command":{"arguments":[{"args":{"cargoArgs":["test","--doc"],"cargoExtra= Args":[],"executableArgs":["option::Option::zip","--nocapture"],"overrid= eCargo":null},"kind":"cargo","label":"doctest option::Option::zip","loca= tion":{"targetRange":{"end":{"character":5,"line":1658},"start":{"character= ":4,"line":1632}},"targetSelectionRange":{"end":{"character":5,"line":1658}= ,"start":{"character":4,"line":1632}},"targetUri":"file:///home/dick/.rustu= p/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/c= ore/src/option.rs"}}],"command":"rust-analyzer.runSingle","title":"=E2=96= =B6=EF=B8=8E Run Doctest"},"range":{"end":{"character":5,"line":1658},"star= t":{"character":4,"line":1632}}},{"command":{"arguments":[{"args":{"cargoAr= gs":["test","--doc"],"cargoExtraArgs":[],"executableArgs":["option::Option<= T>::zip_with","--nocapture"],"overrideCargo":null},"kind":"cargo","label":"= doctest option::Option::zip_with","location":{"targetRange":{"end":{"cha= racter":5,"line":1701},"start":{"character":4,"line":1660}},"targetSelectio= nRange":{"end":{"character":5,"line":1701},"start":{"character":4,"line":16= 60}},"targetUri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknow= n-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"}}],"command":"= rust-analyzer.runSingle","title":"=E2=96=B6=EF=B8=8E Run Doctest"},"range":= {"end":{"character":5,"line":1701},"start":{"character":4,"line":1660}}},{"= command":{"arguments":[{"args":{"cargoArgs":["test","--doc"],"cargoExtraArg= s":[],"executableArgs":["option::Option<(T,U)>::unzip","--nocapture"],"over= rideCargo":null},"kind":"cargo","label":"doctest option::Option<(T,U)>::unz= ip","location":{"targetRange":{"end":{"character":5,"line":1728},"start":{"= character":4,"line":1705}},"targetSelectionRange":{"end":{"character":5,"li= ne":1728},"start":{"character":4,"line":1705}},"targetUri":"file:///home/di= ck/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/= library/core/src/option.rs"}}],"command":"rust-analyzer.runSingle","title":= "=E2=96=B6=EF=B8=8E Run Doctest"},"range":{"end":{"character":5,"line":1728= },"start":{"character":4,"line":1705}}},{"command":{"arguments":[{"args":{"= cargoArgs":["test","--doc"],"cargoExtraArgs":[],"executableArgs":["option::= Option<&T>::copied","--nocapture"],"overrideCargo":null},"kind":"cargo","la= bel":"doctest option::Option<&T>::copied","location":{"targetRange":{"end":= {"character":5,"line":1757},"start":{"character":4,"line":1732}},"targetSel= ectionRange":{"end":{"character":5,"line":1757},"start":{"character":4,"lin= e":1732}},"targetUri":"file:///home/dick/.rustup/toolchains/stable-x86_64-u= nknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"}}],"comma= nd":"rust-analyzer.runSingle","title":"=E2=96=B6=EF=B8=8E Run Doctest"},"ra= nge":{"end":{"character":5,"line":1757},"start":{"character":4,"line":1732}= }},{"command":{"arguments":[{"args":{"cargoArgs":["test","--doc"],"cargoExt= raArgs":[],"executableArgs":["option::Option<&T>::cloned","--nocapture"],"o= verrideCargo":null},"kind":"cargo","label":"doctest option::Option<&T>::clo= ned","location":{"targetRange":{"end":{"character":5,"line":1782},"start":{= "character":4,"line":1759}},"targetSelectionRange":{"end":{"character":5,"l= ine":1782},"start":{"character":4,"line":1759}},"targetUri":"file:///home/d= ick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust= /library/core/src/option.rs"}}],"command":"rust-analyzer.runSingle","title"= :"=E2=96=B6=EF=B8=8E Run Doctest"},"range":{"end":{"character":5,"line":178= 2},"start":{"character":4,"line":1759}}},{"command":{"arguments":[{"args":{= "cargoArgs":["test","--doc"],"cargoExtraArgs":[],"executableArgs":["option:= :Option<&mutT>::copied","--nocapture"],"overrideCargo":null},"kind":"cargo"= ,"label":"doctest option::Option<&mutT>::copied","location":{"targetRange":= {"end":{"character":5,"line":1809},"start":{"character":4,"line":1786}},"ta= rgetSelectionRange":{"end":{"character":5,"line":1809},"start":{"character"= :4,"line":1786}},"targetUri":"file:///home/dick/.rustup/toolchains/stable-x= 86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"}}]= ,"command":"rust-analyzer.runSingle","title":"=E2=96=B6=EF=B8=8E Run Doctes= t"},"range":{"end":{"character":5,"line":1809},"start":{"character":4,"line= ":1786}}},{"command":{"arguments":[{"args":{"cargoArgs":["test","--doc"],"c= argoExtraArgs":[],"executableArgs":["option::Option<&mutT>::cloned","--noca= pture"],"overrideCargo":null},"kind":"cargo","label":"doctest option::Optio= n<&mutT>::cloned","location":{"targetRange":{"end":{"character":5,"line":18= 34},"start":{"character":4,"line":1811}},"targetSelectionRange":{"end":{"ch= aracter":5,"line":1834},"start":{"character":4,"line":1811}},"targetUri":"f= ile:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rus= tlib/src/rust/library/core/src/option.rs"}}],"command":"rust-analyzer.runSi= ngle","title":"=E2=96=B6=EF=B8=8E Run Doctest"},"range":{"end":{"character"= :5,"line":1834},"start":{"character":4,"line":1811}}},{"command":{"argument= s":[{"args":{"cargoArgs":["test","--doc"],"cargoExtraArgs":[],"executableAr= gs":["option::Option>::transpose","--nocapture"],"overrideCargo= ":null},"kind":"cargo","label":"doctest option::Option>::transp= ose","location":{"targetRange":{"end":{"character":5,"line":1863},"start":{= "character":4,"line":1838}},"targetSelectionRange":{"end":{"character":5,"l= ine":1863},"start":{"character":4,"line":1838}},"targetUri":"file:///home/d= ick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust= /library/core/src/option.rs"}}],"command":"rust-analyzer.runSingle","title"= :"=E2=96=B6=EF=B8=8E Run Doctest"},"range":{"end":{"character":5,"line":186= 3},"start":{"character":4,"line":1838}}},{"command":{"arguments":[{"args":{= "cargoArgs":["test","--doc"],"cargoExtraArgs":[],"executableArgs":["option:= :Option::default","--nocapture"],"overrideCargo":null},"kind":"cargo","l= abel":"doctest option::Option::default","location":{"targetRange":{"end"= :{"character":5,"line":1917},"start":{"character":4,"line":1906}},"targetSe= lectionRange":{"end":{"character":5,"line":1917},"start":{"character":4,"li= ne":1906}},"targetUri":"file:///home/dick/.rustup/toolchains/stable-x86_64-= unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"}}],"comm= and":"rust-analyzer.runSingle","title":"=E2=96=B6=EF=B8=8E Run Doctest"},"r= ange":{"end":{"character":5,"line":1917},"start":{"character":4,"line":1906= }}},{"command":{"arguments":[{"args":{"cargoArgs":["test","--doc"],"cargoEx= traArgs":[],"executableArgs":["option::Option::into_iter","--nocapture"]= ,"overrideCargo":null},"kind":"cargo","label":"doctest option::Option::i= nto_iter","location":{"targetRange":{"end":{"character":5,"line":1941},"sta= rt":{"character":4,"line":1925}},"targetSelectionRange":{"end":{"character"= :5,"line":1941},"start":{"character":4,"line":1925}},"targetUri":"file:///h= ome/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src= /rust/library/core/src/option.rs"}}],"command":"rust-analyzer.runSingle","t= itle":"=E2=96=B6=EF=B8=8E Run Doctest"},"range":{"end":{"character":5,"line= ":1941},"start":{"character":4,"line":1925}}},{"command":{"arguments":[{"ar= gs":{"cargoArgs":["test","--doc"],"cargoExtraArgs":[],"executableArgs":["op= tion::Option::from","--nocapture"],"overrideCargo":null},"kind":"cargo",= "label":"doctest option::Option::from","location":{"targetRange":{"end":= {"character":5,"line":1978},"start":{"character":4,"line":1967}},"targetSel= ectionRange":{"end":{"character":5,"line":1978},"start":{"character":4,"lin= e":1967}},"targetUri":"file:///home/dick/.rustup/toolchains/stable-x86_64-u= nknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"}}],"comma= nd":"rust-analyzer.runSingle","title":"=E2=96=B6=EF=B8=8E Run Doctest"},"ra= nge":{"end":{"character":5,"line":1978},"start":{"character":4,"line":1967}= }},{"command":{"arguments":[{"args":{"cargoArgs":["test","--doc"],"cargoExt= raArgs":[],"executableArgs":["option::Option<&T>::from","--nocapture"],"ove= rrideCargo":null},"kind":"cargo","label":"doctest option::Option<&T>::from"= ,"location":{"targetRange":{"end":{"character":5,"line":2006},"start":{"cha= racter":4,"line":1984}},"targetSelectionRange":{"end":{"character":5,"line"= :2006},"start":{"character":4,"line":1984}},"targetUri":"file:///home/dick/= .rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/lib= rary/core/src/option.rs"}}],"command":"rust-analyzer.runSingle","title":"= =E2=96=B6=EF=B8=8E Run Doctest"},"range":{"end":{"character":5,"line":2006}= ,"start":{"character":4,"line":1984}}},{"command":{"arguments":[{"args":{"c= argoArgs":["test","--doc"],"cargoExtraArgs":[],"executableArgs":["option::O= ption<&mutT>::from","--nocapture"],"overrideCargo":null},"kind":"cargo","la= bel":"doctest option::Option<&mutT>::from","location":{"targetRange":{"end"= :{"character":5,"line":2029},"start":{"character":4,"line":2012}},"targetSe= lectionRange":{"end":{"character":5,"line":2029},"start":{"character":4,"li= ne":2012}},"targetUri":"file:///home/dick/.rustup/toolchains/stable-x86_64-= unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"}}],"comm= and":"rust-analyzer.runSingle","title":"=E2=96=B6=EF=B8=8E Run Doctest"},"r= ange":{"end":{"character":5,"line":2029},"start":{"character":4,"line":2012= }}},{"command":{"arguments":[{"args":{"cargoArgs":["test","--doc"],"cargoEx= traArgs":[],"executableArgs":["option::Option::from_iter","--nocapture"]= ,"overrideCargo":null},"kind":"cargo","label":"doctest option::Option::f= rom_iter","location":{"targetRange":{"end":{"character":5,"line":2274},"sta= rt":{"character":4,"line":2208}},"targetSelectionRange":{"end":{"character"= :5,"line":2274},"start":{"character":4,"line":2208}},"targetUri":"file:///h= ome/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src= /rust/library/core/src/option.rs"}}],"command":"rust-analyzer.runSingle","t= itle":"=E2=96=B6=EF=B8=8E Run Doctest"},"range":{"end":{"character":5,"line= ":2274},"start":{"character":4,"line":2208}}},{"command":{"arguments":[{"ar= gs":{"cargoArgs":["test","--doc"],"cargoExtraArgs":[],"executableArgs":["op= tion::Option>::flatten","--nocapture"],"overrideCargo":null},"kin= d":"cargo","label":"doctest option::Option>::flatten","location":= {"targetRange":{"end":{"character":5,"line":2354},"start":{"character":4,"l= ine":2322}},"targetSelectionRange":{"end":{"character":5,"line":2354},"star= t":{"character":4,"line":2322}},"targetUri":"file:///home/dick/.rustup/tool= chains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/sr= c/option.rs"}}],"command":"rust-analyzer.runSingle","title":"=E2=96=B6=EF= =B8=8E Run Doctest"},"range":{"end":{"character":5,"line":2354},"start":{"c= haracter":4,"line":2322}}},{"command":{"arguments":["file:///home/dick/.rus= tup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library= /core/src/option.rs",{"character":9,"line":517},[{"range":{"end":{"characte= r":1,"line":1702},"start":{"character":0,"line":532}},"uri":"file:///home/d= ick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust= /library/core/src/option.rs"},{"range":{"end":{"character":1,"line":1729},"= start":{"character":0,"line":1704}},"uri":"file:///home/dick/.rustup/toolch= ains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/= option.rs"},{"range":{"end":{"character":1,"line":1783},"start":{"character= ":0,"line":1731}},"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64= -unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"},{"rang= e":{"end":{"character":1,"line":1835},"start":{"character":0,"line":1785}},= "uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu= /lib/rustlib/src/rust/library/core/src/option.rs"},{"range":{"end":{"charac= ter":1,"line":1864},"start":{"character":0,"line":1837}},"uri":"file:///hom= e/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/r= ust/library/core/src/option.rs"},{"range":{"end":{"character":1,"line":2355= },"start":{"character":0,"line":2321}},"uri":"file:///home/dick/.rustup/too= lchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/s= rc/option.rs"},{"range":{"end":{"character":1,"line":77},"start":{"characte= r":0,"line":72}},"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-= unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/is_zero.rs"},{= "range":{"end":{"character":1,"line":84},"start":{"character":0,"line":79}}= ,"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gn= u/lib/rustlib/src/rust/library/alloc/src/vec/is_zero.rs"},{"range":{"end":{= "character":2,"line":117},"start":{"character":0,"line":104}},"uri":"file:/= //home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/= src/rust/library/alloc/src/vec/is_zero.rs"},{"range":{"end":{"character":2,= "line":117},"start":{"character":0,"line":104}},"uri":"file:///home/dick/.r= ustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/libra= ry/alloc/src/vec/is_zero.rs"},{"range":{"end":{"character":2,"line":117},"s= tart":{"character":0,"line":104}},"uri":"file:///home/dick/.rustup/toolchai= ns/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/v= ec/is_zero.rs"},{"range":{"end":{"character":2,"line":117},"start":{"charac= ter":0,"line":104}},"uri":"file:///home/dick/.rustup/toolchains/stable-x86_= 64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/is_zero.rs"= },{"range":{"end":{"character":2,"line":117},"start":{"character":0,"line":= 104}},"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-lin= ux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/is_zero.rs"},{"range":{"e= nd":{"character":2,"line":117},"start":{"character":0,"line":104}},"uri":"f= ile:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rus= tlib/src/rust/library/alloc/src/vec/is_zero.rs"},{"range":{"end":{"characte= r":2,"line":117},"start":{"character":0,"line":104}},"uri":"file:///home/di= ck/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/= library/alloc/src/vec/is_zero.rs"},{"range":{"end":{"character":2,"line":11= 7},"start":{"character":0,"line":104}},"uri":"file:///home/dick/.rustup/too= lchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/= src/vec/is_zero.rs"},{"range":{"end":{"character":2,"line":117},"start":{"c= haracter":0,"line":104}},"uri":"file:///home/dick/.rustup/toolchains/stable= -x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/is_zer= o.rs"},{"range":{"end":{"character":2,"line":117},"start":{"character":0,"l= ine":104}},"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknow= n-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/is_zero.rs"},{"range= ":{"end":{"character":2,"line":117},"start":{"character":0,"line":104}},"ur= i":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/li= b/rustlib/src/rust/library/alloc/src/vec/is_zero.rs"},{"range":{"end":{"cha= racter":2,"line":117},"start":{"character":0,"line":104}},"uri":"file:///ho= me/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/= rust/library/alloc/src/vec/is_zero.rs"},{"range":{"end":{"character":60,"li= ne":514},"start":{"character":0,"line":514}},"uri":"file:///home/dick/.rust= up/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/= core/src/option.rs"},{"range":{"end":{"character":1,"line":2306},"start":{"= character":0,"line":2297}},"uri":"file:///home/dick/.rustup/toolchains/stab= le-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs= "},{"range":{"end":{"character":1,"line":2314},"start":{"character":0,"line= ":2308}},"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-= linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"},{"range":{"end"= :{"character":1,"line":2275},"start":{"character":0,"line":2206}},"uri":"fi= le:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rust= lib/src/rust/library/core/src/option.rs"},{"range":{"end":{"character":60,"= line":514},"start":{"character":0,"line":514}},"uri":"file:///home/dick/.ru= stup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/librar= y/core/src/option.rs"},{"range":{"end":{"character":1,"line":1979},"start":= {"character":0,"line":1964}},"uri":"file:///home/dick/.rustup/toolchains/st= able-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.= rs"},{"range":{"end":{"character":1,"line":2007},"start":{"character":0,"li= ne":1981}},"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknow= n-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"},{"range":{"en= d":{"character":1,"line":2030},"start":{"character":0,"line":2009}},"uri":"= file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/ru= stlib/src/rust/library/core/src/option.rs"},{"range":{"end":{"character":1,= "line":1901},"start":{"character":0,"line":1880}},"uri":"file:///home/dick/= .rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/lib= rary/core/src/option.rs"},{"range":{"end":{"character":60,"line":514},"star= t":{"character":0,"line":514}},"uri":"file:///home/dick/.rustup/toolchains/= stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/optio= n.rs"},{"range":{"end":{"character":1,"line":2295},"start":{"character":0,"= line":2277}},"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unkn= own-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"},{"range":{"= end":{"character":1,"line":230},"start":{"character":0,"line":216}},"uri":"= file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/ru= stlib/src/rust/library/core/src/iter/traits/accum.rs"},{"range":{"end":{"ch= aracter":60,"line":514},"start":{"character":0,"line":514}},"uri":"file:///= home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/sr= c/rust/library/core/src/option.rs"},{"range":{"end":{"character":1,"line":2= 319},"start":{"character":0,"line":2316}},"uri":"file:///home/dick/.rustup/= toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/cor= e/src/option.rs"},{"range":{"end":{"character":1,"line":1942},"start":{"cha= racter":0,"line":1920}},"uri":"file:///home/dick/.rustup/toolchains/stable-= x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"},= {"range":{"end":{"character":1,"line":1952},"start":{"character":0,"line":1= 944}},"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-lin= ux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"},{"range":{"end":{"= character":1,"line":1962},"start":{"character":0,"line":1954}},"uri":"file:= ///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib= /src/rust/library/core/src/option.rs"},{"range":{"end":{"character":60,"lin= e":514},"start":{"character":0,"line":514}},"uri":"file:///home/dick/.rustu= p/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/c= ore/src/option.rs"},{"range":{"end":{"character":1,"line":157},"start":{"ch= aracter":0,"line":149}},"uri":"file:///home/dick/.rustup/toolchains/stable-= x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/cmp.rs= "},{"range":{"end":{"character":60,"line":514},"start":{"character":0,"line= ":514}},"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-l= inux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"},{"range":{"end":= {"character":2,"line":215},"start":{"character":0,"line":198}},"uri":"file:= ///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib= /src/rust/library/core/src/array/equality.rs"},{"range":{"end":{"character"= :2,"line":215},"start":{"character":0,"line":198}},"uri":"file:///home/dick= /.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/li= brary/core/src/array/equality.rs"},{"range":{"end":{"character":2,"line":21= 5},"start":{"character":0,"line":198}},"uri":"file:///home/dick/.rustup/too= lchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/s= rc/array/equality.rs"},{"range":{"end":{"character":2,"line":215},"start":{= "character":0,"line":198}},"uri":"file:///home/dick/.rustup/toolchains/stab= le-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/array/equ= ality.rs"},{"range":{"end":{"character":2,"line":215},"start":{"character":= 0,"line":198}},"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-un= known-linux-gnu/lib/rustlib/src/rust/library/core/src/array/equality.rs"},{= "range":{"end":{"character":2,"line":215},"start":{"character":0,"line":198= }},"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-= gnu/lib/rustlib/src/rust/library/core/src/array/equality.rs"},{"range":{"en= d":{"character":2,"line":215},"start":{"character":0,"line":198}},"uri":"fi= le:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rust= lib/src/rust/library/core/src/array/equality.rs"},{"range":{"end":{"charact= er":2,"line":215},"start":{"character":0,"line":198}},"uri":"file:///home/d= ick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust= /library/core/src/array/equality.rs"},{"range":{"end":{"character":2,"line"= :215},"start":{"character":0,"line":198}},"uri":"file:///home/dick/.rustup/= toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/cor= e/src/array/equality.rs"},{"range":{"end":{"character":2,"line":215},"start= ":{"character":0,"line":198}},"uri":"file:///home/dick/.rustup/toolchains/s= table-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/array/= equality.rs"},{"range":{"end":{"character":2,"line":215},"start":{"characte= r":0,"line":198}},"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64= -unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/array/equality.rs"= },{"range":{"end":{"character":2,"line":215},"start":{"character":0,"line":= 198}},"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-lin= ux-gnu/lib/rustlib/src/rust/library/core/src/array/equality.rs"},{"range":{= "end":{"character":1,"line":214},"start":{"character":0,"line":189}},"uri":= "file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/r= ustlib/src/rust/library/core/src/iter/traits/accum.rs"},{"range":{"end":{"c= haracter":1,"line":1918},"start":{"character":0,"line":1903}},"uri":"file:/= //home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/= src/rust/library/core/src/option.rs"},{"range":{"end":{"character":60,"line= ":514},"start":{"character":0,"line":514}},"uri":"file:///home/dick/.rustup= /toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/co= re/src/option.rs"},{"range":{"end":{"character":2,"line":426},"start":{"cha= racter":0,"line":421}},"uri":"file:///home/dick/.rustup/toolchains/stable-x= 86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/proc_macro/src/bridge/= mod.rs"},{"range":{"end":{"character":2,"line":426},"start":{"character":0,= "line":421}},"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unkn= own-linux-gnu/lib/rustlib/src/rust/library/proc_macro/src/bridge/mod.rs"},{= "range":{"end":{"character":2,"line":426},"start":{"character":0,"line":421= }},"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-= gnu/lib/rustlib/src/rust/library/proc_macro/src/bridge/mod.rs"},{"range":{"= end":{"character":2,"line":426},"start":{"character":0,"line":421}},"uri":"= file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/ru= stlib/src/rust/library/proc_macro/src/bridge/mod.rs"},{"range":{"end":{"cha= racter":35,"line":175},"start":{"character":4,"line":175}},"uri":"file:///h= ome/dick/.cargo/registry/src/github.com-1ecc6299db9ec823/anyhow-1.0.32/src/= context.rs"},{"range":{"end":{"character":1,"line":96},"start":{"character"= :0,"line":61}},"uri":"file:///home/dick/.cargo/registry/src/github.com-1ecc= 6299db9ec823/anyhow-1.0.32/src/context.rs"},{"range":{"end":{"character":1,= "line":127},"start":{"character":0,"line":112}},"uri":"file:///home/dick/.c= argo/registry/src/github.com-1ecc6299db9ec823/arc-swap-0.4.7/src/ref_cnt.rs= "},{"range":{"end":{"character":1,"line":14},"start":{"character":0,"line":= 4}},"uri":"file:///home/dick/.cargo/registry/src/github.com-1ecc6299db9ec82= 3/futures-0.1.29/src/future/option.rs"},{"range":{"end":{"character":43,"li= ne":9},"start":{"character":0,"line":9}},"uri":"file:///home/dick/.cargo/re= gistry/src/github.com-1ecc6299db9ec823/jsonrpc-core-15.1.0/src/calls.rs"},{= "range":{"end":{"character":1,"line":386},"start":{"character":0,"line":380= }},"uri":"file:///home/dick/.cargo/registry/src/github.com-1ecc6299db9ec823= /jsonrpc-core-15.1.0/src/io.rs"},{"range":{"end":{"character":1,"line":22},= "start":{"character":0,"line":14}},"uri":"file:///home/dick/.cargo/registry= /src/github.com-1ecc6299db9ec823/parking_lot-0.10.2/src/util.rs"},{"range":= {"end":{"character":1,"line":20},"start":{"character":0,"line":12}},"uri":"= file:///home/dick/.cargo/registry/src/github.com-1ecc6299db9ec823/parking_l= ot_core-0.7.2/src/util.rs"},{"range":{"end":{"character":1,"line":114},"sta= rt":{"character":0,"line":108}},"uri":"file:///home/dick/.cargo/registry/sr= c/github.com-1ecc6299db9ec823/quote-1.0.7/src/to_tokens.rs"},{"range":{"end= ":{"character":1,"line":653},"start":{"character":0,"line":635}},"uri":"fil= e:///home/dick/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.11= 4/src/de/impls.rs"},{"range":{"end":{"character":1,"line":112},"start":{"ch= aracter":0,"line":98}},"uri":"file:///home/dick/.cargo/registry/src/github.= com-1ecc6299db9ec823/serde-1.0.114/src/ser/impls.rs"},{"range":{"end":{"cha= racter":5,"line":2472},"start":{"character":4,"line":2463}},"uri":"file:///= home/dick/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.35/src/ex= pr.rs"},{"range":{"end":{"character":5,"line":655},"start":{"character":4,"= line":647}},"uri":"file:///home/dick/.cargo/registry/src/github.com-1ecc629= 9db9ec823/syn-1.0.35/src/generics.rs"},{"range":{"end":{"character":5,"line= ":819},"start":{"character":4,"line":811}},"uri":"file:///home/dick/.cargo/= registry/src/github.com-1ecc6299db9ec823/syn-1.0.35/src/generics.rs"},{"ran= ge":{"end":{"character":5,"line":1065},"start":{"character":4,"line":1057}}= ,"uri":"file:///home/dick/.cargo/registry/src/github.com-1ecc6299db9ec823/s= yn-1.0.35/src/ty.rs"},{"range":{"end":{"character":1,"line":1045},"start":{= "character":0,"line":1037}},"uri":"file:///home/dick/.cargo/registry/src/gi= thub.com-1ecc6299db9ec823/syn-1.0.35/src/parse.rs"}]],"command":"rust-analy= zer.showReferences","title":"75 implementations"},"data":{"impls":{"positio= n":{"character":9,"line":517},"textDocument":{"uri":"file:///home/dick/.rus= tup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library= /core/src/option.rs"}}},"range":{"end":{"character":15,"line":517},"start":= {"character":9,"line":517}}},{"command":{"arguments":["file:///home/dick/.r= ustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/libra= ry/core/src/option.rs",{"character":7,"line":2037},[{"range":{"end":{"chara= cter":23,"line":2036},"start":{"character":0,"line":2036}},"uri":"file:///h= ome/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src= /rust/library/core/src/option.rs"},{"range":{"end":{"character":1,"line":20= 56},"start":{"character":0,"line":2041}},"uri":"file:///home/dick/.rustup/t= oolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core= /src/option.rs"},{"range":{"end":{"character":40,"line":2067},"start":{"cha= racter":0,"line":2067}},"uri":"file:///home/dick/.rustup/toolchains/stable-= x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"},= {"range":{"end":{"character":23,"line":2036},"start":{"character":0,"line":= 2036}},"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-li= nux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"},{"range":{"end":{= "character":40,"line":2065},"start":{"character":0,"line":2065}},"uri":"fil= e:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustl= ib/src/rust/library/core/src/option.rs"},{"range":{"end":{"character":36,"l= ine":2066},"start":{"character":0,"line":2066}},"uri":"file:///home/dick/.r= ustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/libra= ry/core/src/option.rs"},{"range":{"end":{"character":1,"line":2063},"start"= :{"character":0,"line":2058}},"uri":"file:///home/dick/.rustup/toolchains/s= table-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option= .rs"}]],"command":"rust-analyzer.showReferences","title":"7 implementations= "},"data":{"impls":{"position":{"character":7,"line":2037},"textDocument":{= "uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu= /lib/rustlib/src/rust/library/core/src/option.rs"}}},"range":{"end":{"chara= cter":11,"line":2037},"start":{"character":7,"line":2037}}},{"command":{"ar= guments":["file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux= -gnu/lib/rustlib/src/rust/library/core/src/option.rs",{"character":11,"line= ":2076},[{"range":{"end":{"character":16,"line":2075},"start":{"character":= 0,"line":2075}},"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-u= nknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"},{"range"= :{"end":{"character":1,"line":2092},"start":{"character":0,"line":2080}},"u= ri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/l= ib/rustlib/src/rust/library/core/src/option.rs"},{"range":{"end":{"characte= r":44,"line":2109},"start":{"character":0,"line":2108}},"uri":"file:///home= /dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/ru= st/library/core/src/option.rs"},{"range":{"end":{"character":1,"line":2117}= ,"start":{"character":0,"line":2111}},"uri":"file:///home/dick/.rustup/tool= chains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/sr= c/option.rs"},{"range":{"end":{"character":44,"line":2103},"start":{"charac= ter":0,"line":2102}},"uri":"file:///home/dick/.rustup/toolchains/stable-x86= _64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"},{"r= ange":{"end":{"character":40,"line":2106},"start":{"character":0,"line":210= 5}},"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux= -gnu/lib/rustlib/src/rust/library/core/src/option.rs"},{"range":{"end":{"ch= aracter":1,"line":2100},"start":{"character":0,"line":2094}},"uri":"file://= /home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/s= rc/rust/library/core/src/option.rs"},{"range":{"end":{"character":61,"line"= :137},"start":{"character":0,"line":137}},"uri":"file:///home/dick/.cargo/r= egistry/src/github.com-1ecc6299db9ec823/itertools-0.9.0/src/peeking_take_wh= ile.rs"}]],"command":"rust-analyzer.showReferences","title":"8 implementati= ons"},"data":{"impls":{"position":{"character":11,"line":2076},"textDocumen= t":{"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux= -gnu/lib/rustlib/src/rust/library/core/src/option.rs"}}},"range":{"end":{"c= haracter":15,"line":2076},"start":{"character":11,"line":2076}}},{"command"= :{"arguments":["file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-= linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs",{"character":11,= "line":2126},[{"range":{"end":{"character":16,"line":2125},"start":{"charac= ter":0,"line":2125}},"uri":"file:///home/dick/.rustup/toolchains/stable-x86= _64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"},{"r= ange":{"end":{"character":1,"line":2142},"start":{"character":0,"line":2130= }},"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-= gnu/lib/rustlib/src/rust/library/core/src/option.rs"},{"range":{"end":{"cha= racter":47,"line":2158},"start":{"character":0,"line":2157}},"uri":"file://= /home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/s= rc/rust/library/core/src/option.rs"},{"range":{"end":{"character":47,"line"= :2153},"start":{"character":0,"line":2152}},"uri":"file:///home/dick/.rustu= p/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/c= ore/src/option.rs"},{"range":{"end":{"character":43,"line":2156},"start":{"= character":0,"line":2155}},"uri":"file:///home/dick/.rustup/toolchains/stab= le-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs= "},{"range":{"end":{"character":1,"line":2150},"start":{"character":0,"line= ":2144}},"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-= linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"}]],"command":"ru= st-analyzer.showReferences","title":"6 implementations"},"data":{"impls":{"= position":{"character":11,"line":2126},"textDocument":{"uri":"file:///home/= dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rus= t/library/core/src/option.rs"}}},"range":{"end":{"character":18,"line":2126= },"start":{"character":11,"line":2126}}},{"command":{"arguments":["file:///= home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/sr= c/rust/library/core/src/option.rs",{"character":11,"line":2167},[{"range":{= "end":{"character":23,"line":2165},"start":{"character":0,"line":2165}},"ur= i":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/li= b/rustlib/src/rust/library/core/src/option.rs"},{"range":{"end":{"character= ":1,"line":2183},"start":{"character":0,"line":2171}},"uri":"file:///home/d= ick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust= /library/core/src/option.rs"},{"range":{"end":{"character":44,"line":2200},= "start":{"character":0,"line":2199}},"uri":"file:///home/dick/.rustup/toolc= hains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src= /option.rs"},{"range":{"end":{"character":23,"line":2165},"start":{"charact= er":0,"line":2165}},"uri":"file:///home/dick/.rustup/toolchains/stable-x86_= 64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"},{"ra= nge":{"end":{"character":44,"line":2194},"start":{"character":0,"line":2193= }},"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-= gnu/lib/rustlib/src/rust/library/core/src/option.rs"},{"range":{"end":{"cha= racter":40,"line":2197},"start":{"character":0,"line":2196}},"uri":"file://= /home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/s= rc/rust/library/core/src/option.rs"},{"range":{"end":{"character":1,"line":= 2191},"start":{"character":0,"line":2185}},"uri":"file:///home/dick/.rustup= /toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/co= re/src/option.rs"}]],"command":"rust-analyzer.showReferences","title":"7 im= plementations"},"data":{"impls":{"position":{"character":11,"line":2167},"t= extDocument":{"uri":"file:///home/dick/.rustup/toolchains/stable-x86_64-unk= nown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs"}}},"range":= {"end":{"character":19,"line":2167},"start":{"character":11,"line":2167}}}] 17:00:16 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"mode","params":[],"id":31} 17:00:16 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 31, "jsonr= pc": "2.0", "result": "n"} 17:00:16 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:set_virtual_texts","params":[2,3,0,22,[]],"id":32} 17:00:16 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 32, "jsonr= pc": "2.0", "result": 0} 17:00:16 DEBUG unnamed src/language_client.rs:108 state.inlay_hints./home/d= ick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust= /library/core/src/option.rs: null =3D=3D> [] 17:00:16 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 2, "vie= wport": {"end": 1899, "start": 1877}, "languageId": "rust", "buftype": "", = "position": {"character": 7, "line": 1887}, "filename": "/home/dick/.rustup= /toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/co= re/src/option.rs"}} 17:00:16 INFO unnamed src/language_server_protocol.rs:2873 handle_cursor_mo= ved; params=3DObject({"bufnr": Number(2), "buftype": String(""), "filename"= : String("/home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib= /rustlib/src/rust/library/core/src/option.rs"), "languageId": String("rust"= ), "position": Object({"character": Number(7), "line": Number(1887)}), "vie= wport": Object({"end": Number(1899), "start": Number(1877)})}) force_redraw= =3Dfalse 17:00:16 DEBUG unnamed src/language_client.rs:108 state.last_cursor_line: 4= 9 =3D=3D> 1887 17:00:16 INFO unnamed src/language_server_protocol.rs:2847 get_signs_to_dis= play; filename=3D"/home/dick/.rustup/toolchains/stable-x86_64-unknown-linux= -gnu/lib/rustlib/src/rust/library/core/src/option.rs" viewport=3DViewport {= start: 1877, end: 1899 } 17:00:16 DEBUG unnamed src/language_client.rs:108 state.viewports./home/dic= k/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/l= ibrary/core/src/option.rs: null =3D=3D> {"end":1899,"start":1877} 17:00:16 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:set_signs","params":["/home/dick/.rustup/toolchains/stable-x86_= 64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs",[]],"= id":33} 17:00:16 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 33, "jsonr= pc": "2.0", "result": 0} 17:00:16 DEBUG unnamed src/language_client.rs:108 state.highlights./home/di= ck/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/= library/core/src/option.rs: null =3D=3D> [] 17:00:16 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:ClearHighlights","params":["__LCN_DIAGNOSTIC_HIGHLIGHT__"]} 17:00:16 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"mode","params":[],"id":34} 17:00:16 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 34, "jsonr= pc": "2.0", "result": "n"} 17:00:16 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:set_virtual_texts","params":[2,3,1877,1899,[]],"id":35} 17:00:16 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 35, "jsonr= pc": "2.0", "result": 0} 17:04:21 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 2, "vie= wport": {"end": 22, "start": 0}, "languageId": "rust", "buftype": "", "posi= tion": {"character": 7, "line": 0}, "filename": "/home/dick/.rustup/toolcha= ins/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/o= ption.rs"}} 17:04:21 INFO unnamed src/language_server_protocol.rs:2873 handle_cursor_mo= ved; params=3DObject({"bufnr": Number(2), "buftype": String(""), "filename"= : String("/home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib= /rustlib/src/rust/library/core/src/option.rs"), "languageId": String("rust"= ), "position": Object({"character": Number(7), "line": Number(0)}), "viewpo= rt": Object({"end": Number(22), "start": Number(0)})}) force_redraw=3Dfalse 17:04:21 DEBUG unnamed src/language_client.rs:108 state.last_cursor_line: 1= 887 =3D=3D> 0 17:04:21 INFO unnamed src/language_server_protocol.rs:2847 get_signs_to_dis= play; filename=3D"/home/dick/.rustup/toolchains/stable-x86_64-unknown-linux= -gnu/lib/rustlib/src/rust/library/core/src/option.rs" viewport=3DViewport {= start: 0, end: 22 } 17:04:21 DEBUG unnamed src/language_client.rs:108 state.viewports./home/dic= k/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/l= ibrary/core/src/option.rs.start: 1877 =3D=3D> 0 17:04:21 DEBUG unnamed src/language_client.rs:108 state.viewports./home/dic= k/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/l= ibrary/core/src/option.rs.end: 1899 =3D=3D> 22 17:04:21 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:set_signs","params":["/home/dick/.rustup/toolchains/stable-x86_= 64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs",[]],"= id":36} 17:04:21 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 36, "jsonr= pc": "2.0", "result": 0} 17:04:21 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:ClearHighlights","params":["__LCN_DIAGNOSTIC_HIGHLIGHT__"]} 17:04:21 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"mode","params":[],"id":37} 17:04:21 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 37, "jsonr= pc": "2.0", "result": "n"} 17:04:21 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:set_virtual_texts","params":[2,3,0,22,[]],"id":38} 17:04:21 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 38, "jsonr= pc": "2.0", "result": 0} 17:04:30 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 2, "vie= wport": {"end": 42, "start": 20}, "languageId": "rust", "buftype": "", "pos= ition": {"character": 2, "line": 20}, "filename": "/home/dick/.rustup/toolc= hains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src= /option.rs"}} 17:04:30 INFO unnamed src/language_server_protocol.rs:2873 handle_cursor_mo= ved; params=3DObject({"bufnr": Number(2), "buftype": String(""), "filename"= : String("/home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib= /rustlib/src/rust/library/core/src/option.rs"), "languageId": String("rust"= ), "position": Object({"character": Number(2), "line": Number(20)}), "viewp= ort": Object({"end": Number(42), "start": Number(20)})}) force_redraw=3Dfal= se 17:04:30 DEBUG unnamed src/language_client.rs:108 state.last_cursor_line: 0= =3D=3D> 20 17:04:30 INFO unnamed src/language_server_protocol.rs:2847 get_signs_to_dis= play; filename=3D"/home/dick/.rustup/toolchains/stable-x86_64-unknown-linux= -gnu/lib/rustlib/src/rust/library/core/src/option.rs" viewport=3DViewport {= start: 20, end: 42 } 17:04:30 DEBUG unnamed src/language_client.rs:108 state.viewports./home/dic= k/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/l= ibrary/core/src/option.rs.end: 22 =3D=3D> 42 17:04:30 DEBUG unnamed src/language_client.rs:108 state.viewports./home/dic= k/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/l= ibrary/core/src/option.rs.start: 0 =3D=3D> 20 17:04:30 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:set_signs","params":["/home/dick/.rustup/toolchains/stable-x86_= 64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs",[]],"= id":39} 17:04:30 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 39, "jsonr= pc": "2.0", "result": 0} 17:04:30 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:ClearHighlights","params":["__LCN_DIAGNOSTIC_HIGHLIGHT__"]} 17:04:30 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"mode","params":[],"id":40} 17:04:30 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 40, "jsonr= pc": "2.0", "result": "n"} 17:04:30 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:set_virtual_texts","params":[2,3,20,42,[]],"id":41} 17:04:30 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 41, "jsonr= pc": "2.0", "result": 0} 17:04:30 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 2, "vie= wport": {"end": 62, "start": 40}, "languageId": "rust", "buftype": "", "pos= ition": {"character": 6, "line": 40}, "filename": "/home/dick/.rustup/toolc= hains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src= /option.rs"}} 17:04:30 INFO unnamed src/language_server_protocol.rs:2873 handle_cursor_mo= ved; params=3DObject({"bufnr": Number(2), "buftype": String(""), "filename"= : String("/home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib= /rustlib/src/rust/library/core/src/option.rs"), "languageId": String("rust"= ), "position": Object({"character": Number(6), "line": Number(40)}), "viewp= ort": Object({"end": Number(62), "start": Number(40)})}) force_redraw=3Dfal= se 17:04:30 DEBUG unnamed src/language_client.rs:108 state.last_cursor_line: 2= 0 =3D=3D> 40 17:04:30 INFO unnamed src/language_server_protocol.rs:2847 get_signs_to_dis= play; filename=3D"/home/dick/.rustup/toolchains/stable-x86_64-unknown-linux= -gnu/lib/rustlib/src/rust/library/core/src/option.rs" viewport=3DViewport {= start: 40, end: 62 } 17:04:30 DEBUG unnamed src/language_client.rs:108 state.viewports./home/dic= k/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/l= ibrary/core/src/option.rs.end: 42 =3D=3D> 62 17:04:30 DEBUG unnamed src/language_client.rs:108 state.viewports./home/dic= k/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/l= ibrary/core/src/option.rs.start: 20 =3D=3D> 40 17:04:30 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:set_signs","params":["/home/dick/.rustup/toolchains/stable-x86_= 64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs",[]],"= id":42} 17:04:30 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 42, "jsonr= pc": "2.0", "result": 0} 17:04:30 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:ClearHighlights","params":["__LCN_DIAGNOSTIC_HIGHLIGHT__"]} 17:04:30 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"mode","params":[],"id":43} 17:04:30 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 43, "jsonr= pc": "2.0", "result": "n"} 17:04:30 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:set_virtual_texts","params":[2,3,40,62,[]],"id":44} 17:04:30 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 44, "jsonr= pc": "2.0", "result": 0} 17:04:31 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 2, "vie= wport": {"end": 82, "start": 60}, "languageId": "rust", "buftype": "", "pos= ition": {"character": 7, "line": 60}, "filename": "/home/dick/.rustup/toolc= hains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src= /option.rs"}} 17:04:31 INFO unnamed src/language_server_protocol.rs:2873 handle_cursor_mo= ved; params=3DObject({"bufnr": Number(2), "buftype": String(""), "filename"= : String("/home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib= /rustlib/src/rust/library/core/src/option.rs"), "languageId": String("rust"= ), "position": Object({"character": Number(7), "line": Number(60)}), "viewp= ort": Object({"end": Number(82), "start": Number(60)})}) force_redraw=3Dfal= se 17:04:31 DEBUG unnamed src/language_client.rs:108 state.last_cursor_line: 4= 0 =3D=3D> 60 17:04:31 INFO unnamed src/language_server_protocol.rs:2847 get_signs_to_dis= play; filename=3D"/home/dick/.rustup/toolchains/stable-x86_64-unknown-linux= -gnu/lib/rustlib/src/rust/library/core/src/option.rs" viewport=3DViewport {= start: 60, end: 82 } 17:04:31 DEBUG unnamed src/language_client.rs:108 state.viewports./home/dic= k/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/l= ibrary/core/src/option.rs.end: 62 =3D=3D> 82 17:04:31 DEBUG unnamed src/language_client.rs:108 state.viewports./home/dic= k/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/l= ibrary/core/src/option.rs.start: 40 =3D=3D> 60 17:04:31 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:set_signs","params":["/home/dick/.rustup/toolchains/stable-x86_= 64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs",[]],"= id":45} 17:04:31 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 45, "jsonr= pc": "2.0", "result": 0} 17:04:31 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:ClearHighlights","params":["__LCN_DIAGNOSTIC_HIGHLIGHT__"]} 17:04:31 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"mode","params":[],"id":46} 17:04:31 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 46, "jsonr= pc": "2.0", "result": "n"} 17:04:31 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:set_virtual_texts","params":[2,3,60,82,[]],"id":47} 17:04:31 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 47, "jsonr= pc": "2.0", "result": 0} 17:04:31 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 2, "vie= wport": {"end": 101, "start": 80}, "languageId": "rust", "buftype": "", "po= sition": {"character": 7, "line": 80}, "filename": "/home/dick/.rustup/tool= chains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/sr= c/option.rs"}} 17:04:31 INFO unnamed src/language_server_protocol.rs:2873 handle_cursor_mo= ved; params=3DObject({"bufnr": Number(2), "buftype": String(""), "filename"= : String("/home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib= /rustlib/src/rust/library/core/src/option.rs"), "languageId": String("rust"= ), "position": Object({"character": Number(7), "line": Number(80)}), "viewp= ort": Object({"end": Number(101), "start": Number(80)})}) force_redraw=3Dfa= lse 17:04:31 DEBUG unnamed src/language_client.rs:108 state.last_cursor_line: 6= 0 =3D=3D> 80 17:04:31 INFO unnamed src/language_server_protocol.rs:2847 get_signs_to_dis= play; filename=3D"/home/dick/.rustup/toolchains/stable-x86_64-unknown-linux= -gnu/lib/rustlib/src/rust/library/core/src/option.rs" viewport=3DViewport {= start: 80, end: 101 } 17:04:31 DEBUG unnamed src/language_client.rs:108 state.viewports./home/dic= k/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/l= ibrary/core/src/option.rs.end: 82 =3D=3D> 101 17:04:31 DEBUG unnamed src/language_client.rs:108 state.viewports./home/dic= k/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/l= ibrary/core/src/option.rs.start: 60 =3D=3D> 80 17:04:31 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:set_signs","params":["/home/dick/.rustup/toolchains/stable-x86_= 64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs",[]],"= id":48} 17:04:31 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 48, "jsonr= pc": "2.0", "result": 0} 17:04:31 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:ClearHighlights","params":["__LCN_DIAGNOSTIC_HIGHLIGHT__"]} 17:04:31 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"mode","params":[],"id":49} 17:04:31 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 49, "jsonr= pc": "2.0", "result": "n"} 17:04:31 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:set_virtual_texts","params":[2,3,80,101,[]],"id":50} 17:04:31 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 50, "jsonr= pc": "2.0", "result": 0} 17:04:31 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 2, "vie= wport": {"end": 119, "start": 99}, "languageId": "rust", "buftype": "", "po= sition": {"character": 2, "line": 99}, "filename": "/home/dick/.rustup/tool= chains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/sr= c/option.rs"}} 17:04:31 INFO unnamed src/language_server_protocol.rs:2873 handle_cursor_mo= ved; params=3DObject({"bufnr": Number(2), "buftype": String(""), "filename"= : String("/home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib= /rustlib/src/rust/library/core/src/option.rs"), "languageId": String("rust"= ), "position": Object({"character": Number(2), "line": Number(99)}), "viewp= ort": Object({"end": Number(119), "start": Number(99)})}) force_redraw=3Dfa= lse 17:04:31 DEBUG unnamed src/language_client.rs:108 state.last_cursor_line: 8= 0 =3D=3D> 99 17:04:31 INFO unnamed src/language_server_protocol.rs:2847 get_signs_to_dis= play; filename=3D"/home/dick/.rustup/toolchains/stable-x86_64-unknown-linux= -gnu/lib/rustlib/src/rust/library/core/src/option.rs" viewport=3DViewport {= start: 99, end: 119 } 17:04:31 DEBUG unnamed src/language_client.rs:108 state.viewports./home/dic= k/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/l= ibrary/core/src/option.rs.end: 101 =3D=3D> 119 17:04:31 DEBUG unnamed src/language_client.rs:108 state.viewports./home/dic= k/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/l= ibrary/core/src/option.rs.start: 80 =3D=3D> 99 17:04:31 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:set_signs","params":["/home/dick/.rustup/toolchains/stable-x86_= 64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs",[]],"= id":51} 17:04:31 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 51, "jsonr= pc": "2.0", "result": 0} 17:04:31 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:ClearHighlights","params":["__LCN_DIAGNOSTIC_HIGHLIGHT__"]} 17:04:31 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"mode","params":[],"id":52} 17:04:31 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 52, "jsonr= pc": "2.0", "result": "n"} 17:04:31 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:set_virtual_texts","params":[2,3,99,119,[]],"id":53} 17:04:31 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 53, "jsonr= pc": "2.0", "result": 0} 17:04:32 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 2, "vie= wport": {"end": 139, "start": 117}, "languageId": "rust", "buftype": "", "p= osition": {"character": 7, "line": 117}, "filename": "/home/dick/.rustup/to= olchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/= src/option.rs"}} 17:04:32 INFO unnamed src/language_server_protocol.rs:2873 handle_cursor_mo= ved; params=3DObject({"bufnr": Number(2), "buftype": String(""), "filename"= : String("/home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib= /rustlib/src/rust/library/core/src/option.rs"), "languageId": String("rust"= ), "position": Object({"character": Number(7), "line": Number(117)}), "view= port": Object({"end": Number(139), "start": Number(117)})}) force_redraw=3D= false 17:04:32 DEBUG unnamed src/language_client.rs:108 state.last_cursor_line: 9= 9 =3D=3D> 117 17:04:32 INFO unnamed src/language_server_protocol.rs:2847 get_signs_to_dis= play; filename=3D"/home/dick/.rustup/toolchains/stable-x86_64-unknown-linux= -gnu/lib/rustlib/src/rust/library/core/src/option.rs" viewport=3DViewport {= start: 117, end: 139 } 17:04:32 DEBUG unnamed src/language_client.rs:108 state.viewports./home/dic= k/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/l= ibrary/core/src/option.rs.start: 99 =3D=3D> 117 17:04:32 DEBUG unnamed src/language_client.rs:108 state.viewports./home/dic= k/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/l= ibrary/core/src/option.rs.end: 119 =3D=3D> 139 17:04:32 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:set_signs","params":["/home/dick/.rustup/toolchains/stable-x86_= 64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs",[]],"= id":54} 17:04:32 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 54, "jsonr= pc": "2.0", "result": 0} 17:04:32 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:ClearHighlights","params":["__LCN_DIAGNOSTIC_HIGHLIGHT__"]} 17:04:32 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"mode","params":[],"id":55} 17:04:32 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 55, "jsonr= pc": "2.0", "result": "n"} 17:04:32 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:set_virtual_texts","params":[2,3,117,139,[]],"id":56} 17:04:32 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 56, "jsonr= pc": "2.0", "result": 0} 17:04:32 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 2, "vie= wport": {"end": 159, "start": 137}, "languageId": "rust", "buftype": "", "p= osition": {"character": 2, "line": 137}, "filename": "/home/dick/.rustup/to= olchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/= src/option.rs"}} 17:04:32 INFO unnamed src/language_server_protocol.rs:2873 handle_cursor_mo= ved; params=3DObject({"bufnr": Number(2), "buftype": String(""), "filename"= : String("/home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib= /rustlib/src/rust/library/core/src/option.rs"), "languageId": String("rust"= ), "position": Object({"character": Number(2), "line": Number(137)}), "view= port": Object({"end": Number(159), "start": Number(137)})}) force_redraw=3D= false 17:04:32 DEBUG unnamed src/language_client.rs:108 state.last_cursor_line: 1= 17 =3D=3D> 137 17:04:32 INFO unnamed src/language_server_protocol.rs:2847 get_signs_to_dis= play; filename=3D"/home/dick/.rustup/toolchains/stable-x86_64-unknown-linux= -gnu/lib/rustlib/src/rust/library/core/src/option.rs" viewport=3DViewport {= start: 137, end: 159 } 17:04:32 DEBUG unnamed src/language_client.rs:108 state.viewports./home/dic= k/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/l= ibrary/core/src/option.rs.start: 117 =3D=3D> 137 17:04:32 DEBUG unnamed src/language_client.rs:108 state.viewports./home/dic= k/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/l= ibrary/core/src/option.rs.end: 139 =3D=3D> 159 17:04:32 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:set_signs","params":["/home/dick/.rustup/toolchains/stable-x86_= 64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs",[]],"= id":57} 17:04:32 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 57, "jsonr= pc": "2.0", "result": 0} 17:04:32 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:ClearHighlights","params":["__LCN_DIAGNOSTIC_HIGHLIGHT__"]} 17:04:32 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"mode","params":[],"id":58} 17:04:32 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 58, "jsonr= pc": "2.0", "result": "n"} 17:04:32 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:set_virtual_texts","params":[2,3,137,159,[]],"id":59} 17:04:32 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 59, "jsonr= pc": "2.0", "result": 0} 17:04:32 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 2, "vie= wport": {"end": 179, "start": 157}, "languageId": "rust", "buftype": "", "p= osition": {"character": 7, "line": 157}, "filename": "/home/dick/.rustup/to= olchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/= src/option.rs"}} 17:04:32 INFO unnamed src/language_server_protocol.rs:2873 handle_cursor_mo= ved; params=3DObject({"bufnr": Number(2), "buftype": String(""), "filename"= : String("/home/dick/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib= /rustlib/src/rust/library/core/src/option.rs"), "languageId": String("rust"= ), "position": Object({"character": Number(7), "line": Number(157)}), "view= port": Object({"end": Number(179), "start": Number(157)})}) force_redraw=3D= false 17:04:32 DEBUG unnamed src/language_client.rs:108 state.last_cursor_line: 1= 37 =3D=3D> 157 17:04:32 INFO unnamed src/language_server_protocol.rs:2847 get_signs_to_dis= play; filename=3D"/home/dick/.rustup/toolchains/stable-x86_64-unknown-linux= -gnu/lib/rustlib/src/rust/library/core/src/option.rs" viewport=3DViewport {= start: 157, end: 179 } 17:04:32 DEBUG unnamed src/language_client.rs:108 state.viewports./home/dic= k/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/l= ibrary/core/src/option.rs.start: 137 =3D=3D> 157 17:04:32 DEBUG unnamed src/language_client.rs:108 state.viewports./home/dic= k/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/l= ibrary/core/src/option.rs.end: 159 =3D=3D> 179 17:04:32 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:set_signs","params":["/home/dick/.rustup/toolchains/stable-x86_= 64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs",[]],"= id":60} 17:04:32 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 60, "jsonr= pc": "2.0", "result": 0} 17:04:32 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:ClearHighlights","params":["__LCN_DIAGNOSTIC_HIGHLIGHT__"]} 17:04:32 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"mode","params":[],"id":61} 17:04:32 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 61, "jsonr= pc": "2.0", "result": "n"} 17:04:32 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:set_virtual_texts","params":[2,3,157,179,[]],"id":62} 17:04:32 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 62, "jsonr= pc": "2.0", "result": 0} 17:04:36 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleBufEnter", "jsonrpc": "2.0", "params": {"bufnr": 1, "langua= geId": "rust", "filename": "/home/dick/LanguageClient-neovim/src/rpcclient.= rs"}} 17:04:36 INFO unnamed src/language_server_protocol.rs:2739 handle_buf_enter= ; params=3DObject({"bufnr": Number(1), "filename": String("/home/dick/Langu= ageClient-neovim/src/rpcclient.rs"), "languageId": String("rust")}) 17:04:36 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"setbufvar","params":["/home/dick/LanguageClient-neovim/src/rpccli= ent.rs","LanguageClient_isServerRunning",1]} 17:04:36 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "vie= wport": {"end": 59, "start": 40}, "languageId": "rust", "buftype": "", "pos= ition": {"character": 45, "line": 49}, "filename": "/home/dick/LanguageClie= nt-neovim/src/rpcclient.rs"}} 17:04:36 INFO unnamed src/language_server_protocol.rs:2873 handle_cursor_mo= ved; params=3DObject({"bufnr": Number(1), "buftype": String(""), "filename"= : String("/home/dick/LanguageClient-neovim/src/rpcclient.rs"), "languageId"= : String("rust"), "position": Object({"character": Number(45), "line": Numb= er(49)}), "viewport": Object({"end": Number(59), "start": Number(40)})}) fo= rce_redraw=3Dfalse 17:04:36 DEBUG unnamed src/language_client.rs:108 state.last_cursor_line: 1= 57 =3D=3D> 49 17:04:39 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "vie= wport": {"end": 59, "start": 40}, "languageId": "rust", "buftype": "", "pos= ition": {"character": 45, "line": 50}, "filename": "/home/dick/LanguageClie= nt-neovim/src/rpcclient.rs"}} 17:04:39 INFO unnamed src/language_server_protocol.rs:2873 handle_cursor_mo= ved; params=3DObject({"bufnr": Number(1), "buftype": String(""), "filename"= : String("/home/dick/LanguageClient-neovim/src/rpcclient.rs"), "languageId"= : String("rust"), "position": Object({"character": Number(45), "line": Numb= er(50)}), "viewport": Object({"end": Number(59), "start": Number(40)})}) fo= rce_redraw=3Dfalse 17:04:39 DEBUG unnamed src/language_client.rs:108 state.last_cursor_line: 4= 9 =3D=3D> 50 17:04:39 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "vie= wport": {"end": 59, "start": 40}, "languageId": "rust", "buftype": "", "pos= ition": {"character": 45, "line": 51}, "filename": "/home/dick/LanguageClie= nt-neovim/src/rpcclient.rs"}} 17:04:39 INFO unnamed src/language_server_protocol.rs:2873 handle_cursor_mo= ved; params=3DObject({"bufnr": Number(1), "buftype": String(""), "filename"= : String("/home/dick/LanguageClient-neovim/src/rpcclient.rs"), "languageId"= : String("rust"), "position": Object({"character": Number(45), "line": Numb= er(51)}), "viewport": Object({"end": Number(59), "start": Number(40)})}) fo= rce_redraw=3Dfalse 17:04:39 DEBUG unnamed src/language_client.rs:108 state.last_cursor_line: 5= 0 =3D=3D> 51 17:04:39 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "vie= wport": {"end": 59, "start": 40}, "languageId": "rust", "buftype": "", "pos= ition": {"character": 45, "line": 50}, "filename": "/home/dick/LanguageClie= nt-neovim/src/rpcclient.rs"}} 17:04:39 INFO unnamed src/language_server_protocol.rs:2873 handle_cursor_mo= ved; params=3DObject({"bufnr": Number(1), "buftype": String(""), "filename"= : String("/home/dick/LanguageClient-neovim/src/rpcclient.rs"), "languageId"= : String("rust"), "position": Object({"character": Number(45), "line": Numb= er(50)}), "viewport": Object({"end": Number(59), "start": Number(40)})}) fo= rce_redraw=3Dfalse 17:04:39 DEBUG unnamed src/language_client.rs:108 state.last_cursor_line: 5= 1 =3D=3D> 50 17:04:40 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "vie= wport": {"end": 59, "start": 40}, "languageId": "rust", "buftype": "", "pos= ition": {"character": 45, "line": 49}, "filename": "/home/dick/LanguageClie= nt-neovim/src/rpcclient.rs"}} 17:04:40 INFO unnamed src/language_server_protocol.rs:2873 handle_cursor_mo= ved; params=3DObject({"bufnr": Number(1), "buftype": String(""), "filename"= : String("/home/dick/LanguageClient-neovim/src/rpcclient.rs"), "languageId"= : String("rust"), "position": Object({"character": Number(45), "line": Numb= er(49)}), "viewport": Object({"end": Number(59), "start": Number(40)})}) fo= rce_redraw=3Dfalse 17:04:40 DEBUG unnamed src/language_client.rs:108 state.last_cursor_line: 5= 0 =3D=3D> 49 20:30:13 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "vie= wport": {"end": 59, "start": 40}, "languageId": "rust", "buftype": "", "pos= ition": {"character": 0, "line": 48}, "filename": "/home/dick/LanguageClien= t-neovim/src/rpcclient.rs"}} 20:30:13 INFO unnamed src/language_server_protocol.rs:2873 handle_cursor_mo= ved; params=3DObject({"bufnr": Number(1), "buftype": String(""), "filename"= : String("/home/dick/LanguageClient-neovim/src/rpcclient.rs"), "languageId"= : String("rust"), "position": Object({"character": Number(0), "line": Numbe= r(48)}), "viewport": Object({"end": Number(59), "start": Number(40)})}) for= ce_redraw=3Dfalse 20:30:13 DEBUG unnamed src/language_client.rs:108 state.last_cursor_line: 4= 9 =3D=3D> 48 20:30:13 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "vie= wport": {"end": 59, "start": 40}, "languageId": "rust", "buftype": "", "pos= ition": {"character": 45, "line": 49}, "filename": "/home/dick/LanguageClie= nt-neovim/src/rpcclient.rs"}} 20:30:13 INFO unnamed src/language_server_protocol.rs:2873 handle_cursor_mo= ved; params=3DObject({"bufnr": Number(1), "buftype": String(""), "filename"= : String("/home/dick/LanguageClient-neovim/src/rpcclient.rs"), "languageId"= : String("rust"), "position": Object({"character": Number(45), "line": Numb= er(49)}), "viewport": Object({"end": Number(59), "start": Number(40)})}) fo= rce_redraw=3Dfalse 20:30:13 DEBUG unnamed src/language_client.rs:108 state.last_cursor_line: 4= 8 =3D=3D> 49 20:30:15 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "vie= wport": {"end": 59, "start": 40}, "languageId": "rust", "buftype": "", "pos= ition": {"character": 45, "line": 50}, "filename": "/home/dick/LanguageClie= nt-neovim/src/rpcclient.rs"}} 20:30:15 INFO unnamed src/language_server_protocol.rs:2873 handle_cursor_mo= ved; params=3DObject({"bufnr": Number(1), "buftype": String(""), "filename"= : String("/home/dick/LanguageClient-neovim/src/rpcclient.rs"), "languageId"= : String("rust"), "position": Object({"character": Number(45), "line": Numb= er(50)}), "viewport": Object({"end": Number(59), "start": Number(40)})}) fo= rce_redraw=3Dfalse 20:30:15 DEBUG unnamed src/language_client.rs:108 state.last_cursor_line: 4= 9 =3D=3D> 50 20:30:16 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "vie= wport": {"end": 59, "start": 40}, "languageId": "rust", "buftype": "", "pos= ition": {"character": 45, "line": 51}, "filename": "/home/dick/LanguageClie= nt-neovim/src/rpcclient.rs"}} 20:30:16 INFO unnamed src/language_server_protocol.rs:2873 handle_cursor_mo= ved; params=3DObject({"bufnr": Number(1), "buftype": String(""), "filename"= : String("/home/dick/LanguageClient-neovim/src/rpcclient.rs"), "languageId"= : String("rust"), "position": Object({"character": Number(45), "line": Numb= er(51)}), "viewport": Object({"end": Number(59), "start": Number(40)})}) fo= rce_redraw=3Dfalse 20:30:16 DEBUG unnamed src/language_client.rs:108 state.last_cursor_line: 5= 0 =3D=3D> 51 20:30:16 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "vie= wport": {"end": 59, "start": 40}, "languageId": "rust", "buftype": "", "pos= ition": {"character": 29, "line": 52}, "filename": "/home/dick/LanguageClie= nt-neovim/src/rpcclient.rs"}} 20:30:16 INFO unnamed src/language_server_protocol.rs:2873 handle_cursor_mo= ved; params=3DObject({"bufnr": Number(1), "buftype": String(""), "filename"= : String("/home/dick/LanguageClient-neovim/src/rpcclient.rs"), "languageId"= : String("rust"), "position": Object({"character": Number(29), "line": Numb= er(52)}), "viewport": Object({"end": Number(59), "start": Number(40)})}) fo= rce_redraw=3Dfalse 20:30:16 DEBUG unnamed src/language_client.rs:108 state.last_cursor_line: 5= 1 =3D=3D> 52 20:30:17 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "vie= wport": {"end": 59, "start": 40}, "languageId": "rust", "buftype": "", "pos= ition": {"character": 45, "line": 51}, "filename": "/home/dick/LanguageClie= nt-neovim/src/rpcclient.rs"}} 20:30:17 INFO unnamed src/language_server_protocol.rs:2873 handle_cursor_mo= ved; params=3DObject({"bufnr": Number(1), "buftype": String(""), "filename"= : String("/home/dick/LanguageClient-neovim/src/rpcclient.rs"), "languageId"= : String("rust"), "position": Object({"character": Number(45), "line": Numb= er(51)}), "viewport": Object({"end": Number(59), "start": Number(40)})}) fo= rce_redraw=3Dfalse 20:30:17 DEBUG unnamed src/language_client.rs:108 state.last_cursor_line: 5= 2 =3D=3D> 51 20:30:17 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "vie= wport": {"end": 59, "start": 40}, "languageId": "rust", "buftype": "", "pos= ition": {"character": 45, "line": 50}, "filename": "/home/dick/LanguageClie= nt-neovim/src/rpcclient.rs"}} 20:30:17 INFO unnamed src/language_server_protocol.rs:2873 handle_cursor_mo= ved; params=3DObject({"bufnr": Number(1), "buftype": String(""), "filename"= : String("/home/dick/LanguageClient-neovim/src/rpcclient.rs"), "languageId"= : String("rust"), "position": Object({"character": Number(45), "line": Numb= er(50)}), "viewport": Object({"end": Number(59), "start": Number(40)})}) fo= rce_redraw=3Dfalse 20:30:17 DEBUG unnamed src/language_client.rs:108 state.last_cursor_line: 5= 1 =3D=3D> 50 20:30:17 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "vie= wport": {"end": 59, "start": 40}, "languageId": "rust", "buftype": "", "pos= ition": {"character": 45, "line": 49}, "filename": "/home/dick/LanguageClie= nt-neovim/src/rpcclient.rs"}} 20:30:17 INFO unnamed src/language_server_protocol.rs:2873 handle_cursor_mo= ved; params=3DObject({"bufnr": Number(1), "buftype": String(""), "filename"= : String("/home/dick/LanguageClient-neovim/src/rpcclient.rs"), "languageId"= : String("rust"), "position": Object({"character": Number(45), "line": Numb= er(49)}), "viewport": Object({"end": Number(59), "start": Number(40)})}) fo= rce_redraw=3Dfalse 20:30:17 DEBUG unnamed src/language_client.rs:108 state.last_cursor_line: 5= 0 =3D=3D> 49 20:30:18 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "vie= wport": {"end": 59, "start": 40}, "languageId": "rust", "buftype": "", "pos= ition": {"character": 0, "line": 48}, "filename": "/home/dick/LanguageClien= t-neovim/src/rpcclient.rs"}} 20:30:18 INFO unnamed src/language_server_protocol.rs:2873 handle_cursor_mo= ved; params=3DObject({"bufnr": Number(1), "buftype": String(""), "filename"= : String("/home/dick/LanguageClient-neovim/src/rpcclient.rs"), "languageId"= : String("rust"), "position": Object({"character": Number(0), "line": Numbe= r(48)}), "viewport": Object({"end": Number(59), "start": Number(40)})}) for= ce_redraw=3Dfalse 20:30:18 DEBUG unnamed src/language_client.rs:108 state.last_cursor_line: 4= 9 =3D=3D> 48 20:30:19 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "vie= wport": {"end": 59, "start": 40}, "languageId": "rust", "buftype": "", "pos= ition": {"character": 45, "line": 49}, "filename": "/home/dick/LanguageClie= nt-neovim/src/rpcclient.rs"}} 20:30:19 INFO unnamed src/language_server_protocol.rs:2873 handle_cursor_mo= ved; params=3DObject({"bufnr": Number(1), "buftype": String(""), "filename"= : String("/home/dick/LanguageClient-neovim/src/rpcclient.rs"), "languageId"= : String("rust"), "position": Object({"character": Number(45), "line": Numb= er(49)}), "viewport": Object({"end": Number(59), "start": Number(40)})}) fo= rce_redraw=3Dfalse 20:30:19 DEBUG unnamed src/language_client.rs:108 state.last_cursor_line: 4= 8 =3D=3D> 49 22:39:14 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "vie= wport": {"end": 59, "start": 40}, "languageId": "rust", "buftype": "", "pos= ition": {"character": 45, "line": 50}, "filename": "/home/dick/LanguageClie= nt-neovim/src/rpcclient.rs"}} 22:39:14 INFO unnamed src/language_server_protocol.rs:2873 handle_cursor_mo= ved; params=3DObject({"bufnr": Number(1), "buftype": String(""), "filename"= : String("/home/dick/LanguageClient-neovim/src/rpcclient.rs"), "languageId"= : String("rust"), "position": Object({"character": Number(45), "line": Numb= er(50)}), "viewport": Object({"end": Number(59), "start": Number(40)})}) fo= rce_redraw=3Dfalse 22:39:14 DEBUG unnamed src/language_client.rs:108 state.last_cursor_line: 4= 9 =3D=3D> 50 22:39:15 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "vie= wport": {"end": 59, "start": 40}, "languageId": "rust", "buftype": "", "pos= ition": {"character": 45, "line": 51}, "filename": "/home/dick/LanguageClie= nt-neovim/src/rpcclient.rs"}} 22:39:15 INFO unnamed src/language_server_protocol.rs:2873 handle_cursor_mo= ved; params=3DObject({"bufnr": Number(1), "buftype": String(""), "filename"= : String("/home/dick/LanguageClient-neovim/src/rpcclient.rs"), "languageId"= : String("rust"), "position": Object({"character": Number(45), "line": Numb= er(51)}), "viewport": Object({"end": Number(59), "start": Number(40)})}) fo= rce_redraw=3Dfalse 22:39:15 DEBUG unnamed src/language_client.rs:108 state.last_cursor_line: 5= 0 =3D=3D> 51 22:39:15 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "vie= wport": {"end": 59, "start": 40}, "languageId": "rust", "buftype": "", "pos= ition": {"character": 45, "line": 50}, "filename": "/home/dick/LanguageClie= nt-neovim/src/rpcclient.rs"}} 22:39:15 INFO unnamed src/language_server_protocol.rs:2873 handle_cursor_mo= ved; params=3DObject({"bufnr": Number(1), "buftype": String(""), "filename"= : String("/home/dick/LanguageClient-neovim/src/rpcclient.rs"), "languageId"= : String("rust"), "position": Object({"character": Number(45), "line": Numb= er(50)}), "viewport": Object({"end": Number(59), "start": Number(40)})}) fo= rce_redraw=3Dfalse 22:39:15 DEBUG unnamed src/language_client.rs:108 state.last_cursor_line: 5= 1 =3D=3D> 50 22:39:15 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "vie= wport": {"end": 59, "start": 40}, "languageId": "rust", "buftype": "", "pos= ition": {"character": 45, "line": 49}, "filename": "/home/dick/LanguageClie= nt-neovim/src/rpcclient.rs"}} 22:39:15 INFO unnamed src/language_server_protocol.rs:2873 handle_cursor_mo= ved; params=3DObject({"bufnr": Number(1), "buftype": String(""), "filename"= : String("/home/dick/LanguageClient-neovim/src/rpcclient.rs"), "languageId"= : String("rust"), "position": Object({"character": Number(45), "line": Numb= er(49)}), "viewport": Object({"end": Number(59), "start": Number(40)})}) fo= rce_redraw=3Dfalse 22:39:15 DEBUG unnamed src/language_client.rs:108 state.last_cursor_line: 5= 0 =3D=3D> 49 22:39:15 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "vie= wport": {"end": 59, "start": 40}, "languageId": "rust", "buftype": "", "pos= ition": {"character": 0, "line": 48}, "filename": "/home/dick/LanguageClien= t-neovim/src/rpcclient.rs"}} 22:39:15 INFO unnamed src/language_server_protocol.rs:2873 handle_cursor_mo= ved; params=3DObject({"bufnr": Number(1), "buftype": String(""), "filename"= : String("/home/dick/LanguageClient-neovim/src/rpcclient.rs"), "languageId"= : String("rust"), "position": Object({"character": Number(0), "line": Numbe= r(48)}), "viewport": Object({"end": Number(59), "start": Number(40)})}) for= ce_redraw=3Dfalse 22:39:15 DEBUG unnamed src/language_client.rs:108 state.last_cursor_line: 4= 9 =3D=3D> 48 22:39:17 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "vie= wport": {"end": 59, "start": 40}, "languageId": "rust", "buftype": "", "pos= ition": {"character": 45, "line": 49}, "filename": "/home/dick/LanguageClie= nt-neovim/src/rpcclient.rs"}} 22:39:17 INFO unnamed src/language_server_protocol.rs:2873 handle_cursor_mo= ved; params=3DObject({"bufnr": Number(1), "buftype": String(""), "filename"= : String("/home/dick/LanguageClient-neovim/src/rpcclient.rs"), "languageId"= : String("rust"), "position": Object({"character": Number(45), "line": Numb= er(49)}), "viewport": Object({"end": Number(59), "start": Number(40)})}) fo= rce_redraw=3Dfalse 22:39:17 DEBUG unnamed src/language_client.rs:108 state.last_cursor_line: 4= 8 =3D=3D> 49 22:39:17 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "vie= wport": {"end": 59, "start": 40}, "languageId": "rust", "buftype": "", "pos= ition": {"character": 0, "line": 48}, "filename": "/home/dick/LanguageClien= t-neovim/src/rpcclient.rs"}} 22:39:17 INFO unnamed src/language_server_protocol.rs:2873 handle_cursor_mo= ved; params=3DObject({"bufnr": Number(1), "buftype": String(""), "filename"= : String("/home/dick/LanguageClient-neovim/src/rpcclient.rs"), "languageId"= : String("rust"), "position": Object({"character": Number(0), "line": Numbe= r(48)}), "viewport": Object({"end": Number(59), "start": Number(40)})}) for= ce_redraw=3Dfalse 22:39:17 DEBUG unnamed src/language_client.rs:108 state.last_cursor_line: 4= 9 =3D=3D> 48 22:39:18 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "vie= wport": {"end": 59, "start": 40}, "languageId": "rust", "buftype": "", "pos= ition": {"character": 45, "line": 47}, "filename": "/home/dick/LanguageClie= nt-neovim/src/rpcclient.rs"}} 22:39:18 INFO unnamed src/language_server_protocol.rs:2873 handle_cursor_mo= ved; params=3DObject({"bufnr": Number(1), "buftype": String(""), "filename"= : String("/home/dick/LanguageClient-neovim/src/rpcclient.rs"), "languageId"= : String("rust"), "position": Object({"character": Number(45), "line": Numb= er(47)}), "viewport": Object({"end": Number(59), "start": Number(40)})}) fo= rce_redraw=3Dfalse 22:39:18 DEBUG unnamed src/language_client.rs:108 state.last_cursor_line: 4= 8 =3D=3D> 47 22:39:18 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "vie= wport": {"end": 59, "start": 40}, "languageId": "rust", "buftype": "", "pos= ition": {"character": 0, "line": 48}, "filename": "/home/dick/LanguageClien= t-neovim/src/rpcclient.rs"}} 22:39:18 INFO unnamed src/language_server_protocol.rs:2873 handle_cursor_mo= ved; params=3DObject({"bufnr": Number(1), "buftype": String(""), "filename"= : String("/home/dick/LanguageClient-neovim/src/rpcclient.rs"), "languageId"= : String("rust"), "position": Object({"character": Number(0), "line": Numbe= r(48)}), "viewport": Object({"end": Number(59), "start": Number(40)})}) for= ce_redraw=3Dfalse 22:39:18 DEBUG unnamed src/language_client.rs:108 state.last_cursor_line: 4= 7 =3D=3D> 48 22:39:19 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "vie= wport": {"end": 75, "start": 57}, "languageId": "rust", "buftype": "", "pos= ition": {"character": 45, "line": 57}, "filename": "/home/dick/LanguageClie= nt-neovim/src/rpcclient.rs"}} 22:39:19 INFO unnamed src/language_server_protocol.rs:2873 handle_cursor_mo= ved; params=3DObject({"bufnr": Number(1), "buftype": String(""), "filename"= : String("/home/dick/LanguageClient-neovim/src/rpcclient.rs"), "languageId"= : String("rust"), "position": Object({"character": Number(45), "line": Numb= er(57)}), "viewport": Object({"end": Number(75), "start": Number(57)})}) fo= rce_redraw=3Dfalse 22:39:19 DEBUG unnamed src/language_client.rs:108 state.last_cursor_line: 4= 8 =3D=3D> 57 22:39:19 INFO unnamed src/language_server_protocol.rs:2847 get_signs_to_dis= play; filename=3D"/home/dick/LanguageClient-neovim/src/rpcclient.rs" viewpo= rt=3DViewport { start: 57, end: 75 } 22:39:19 DEBUG unnamed src/language_client.rs:108 state.viewports./home/dic= k/LanguageClient-neovim/src/rpcclient.rs.start: 40 =3D=3D> 57 22:39:19 DEBUG unnamed src/language_client.rs:108 state.viewports./home/dic= k/LanguageClient-neovim/src/rpcclient.rs.end: 59 =3D=3D> 75 22:39:19 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:set_signs","params":["/home/dick/LanguageClient-neovim/src/rpcc= lient.rs",[]],"id":63} 22:39:19 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 63, "jsonr= pc": "2.0", "result": 0} 22:39:19 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:ClearHighlights","params":["__LCN_DIAGNOSTIC_HIGHLIGHT__"]} 22:39:19 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"mode","params":[],"id":64} 22:39:19 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 64, "jsonr= pc": "2.0", "result": "n"} 22:39:19 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:set_virtual_texts","params":[1,3,57,75,[]],"id":65} 22:39:19 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 65, "jsonr= pc": "2.0", "result": 0} 22:39:19 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"method": "langu= ageClient/handleCursorMoved", "jsonrpc": "2.0", "params": {"bufnr": 1, "vie= wport": {"end": 59, "start": 40}, "languageId": "rust", "buftype": "", "pos= ition": {"character": 45, "line": 58}, "filename": "/home/dick/LanguageClie= nt-neovim/src/rpcclient.rs"}} 22:39:19 INFO unnamed src/language_server_protocol.rs:2873 handle_cursor_mo= ved; params=3DObject({"bufnr": Number(1), "buftype": String(""), "filename"= : String("/home/dick/LanguageClient-neovim/src/rpcclient.rs"), "languageId"= : String("rust"), "position": Object({"character": Number(45), "line": Numb= er(58)}), "viewport": Object({"end": Number(59), "start": Number(40)})}) fo= rce_redraw=3Dfalse 22:39:19 DEBUG unnamed src/language_client.rs:108 state.last_cursor_line: 5= 7 =3D=3D> 58 22:39:19 INFO unnamed src/language_server_protocol.rs:2847 get_signs_to_dis= play; filename=3D"/home/dick/LanguageClient-neovim/src/rpcclient.rs" viewpo= rt=3DViewport { start: 40, end: 59 } 22:39:19 DEBUG unnamed src/language_client.rs:108 state.viewports./home/dic= k/LanguageClient-neovim/src/rpcclient.rs.end: 75 =3D=3D> 59 22:39:19 DEBUG unnamed src/language_client.rs:108 state.viewports./home/dic= k/LanguageClient-neovim/src/rpcclient.rs.start: 57 =3D=3D> 40 22:39:19 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:set_signs","params":["/home/dick/LanguageClient-neovim/src/rpcc= lient.rs",[]],"id":66} 22:39:19 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 66, "jsonr= pc": "2.0", "result": 0} 22:39:19 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:ClearHighlights","params":["__LCN_DIAGNOSTIC_HIGHLIGHT__"]} 22:39:19 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"mode","params":[],"id":67} 22:39:19 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 67, "jsonr= pc": "2.0", "result": "n"} 22:39:19 DEBUG writer-None src/rpcclient.rs:254 =3D> None {"jsonrpc":"2.0",= "method":"s:set_virtual_texts","params":[1,3,40,59,[]],"id":68} 22:39:19 DEBUG reader-None src/rpcclient.rs:207 <=3D None {"id": 68, "jsonr= pc": "2.0", "result": 0} 16:45:09 INFO reader-None src/rpcclient.rs:241 reader-None terminated --=-=-= Content-Type: text/plain I'm standing by my underwhelming characterization. C-n'ing through a real-world logfile languageclient.out, which I attach again here, chops up at around line 44. This led me to write contrived tests, which of course are frowned upon in your school of measurement, whose modus operandi is interminable catechism between a complainant who laboriously and imprecisely describes slowness, and an inquisitor auto-replying "doesn't happen here." To your credit, underwhelming is far better than ineffable, so I've largely been dismissive of the objections by the usual suspects in Bug#56393. --=-=-=--