adjust Result::Io api

This commit is contained in:
Clément DOUIN
2026-03-03 22:04:27 +01:00
parent 1d72e59c82
commit 588d75f112
12 changed files with 22 additions and 22 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ impl CloseMailboxCommand {
loop {
match close_coroutine.resume(arg.take()) {
ImapCloseResult::Io(io) => arg = Some(handle(&mut stream, io)?),
ImapCloseResult::Io { io } => arg = Some(handle(&mut stream, io)?),
ImapCloseResult::Ok { .. } => break,
ImapCloseResult::Err { err, .. } => bail!(err),
}
+1 -1
View File
@@ -27,7 +27,7 @@ impl CreateMailboxCommand {
loop {
match coroutine.resume(arg.take()) {
ImapCreateResult::Io(io) => arg = Some(handle(&mut stream, io)?),
ImapCreateResult::Io { io } => arg = Some(handle(&mut stream, io)?),
ImapCreateResult::Ok { .. } => break,
ImapCreateResult::Err { err, .. } => bail!(err),
}
+1 -1
View File
@@ -27,7 +27,7 @@ impl DeleteMailboxCommand {
loop {
match coroutine.resume(arg.take()) {
ImapDeleteResult::Io(io) => arg = Some(handle(&mut stream, io)?),
ImapDeleteResult::Io { io } => arg = Some(handle(&mut stream, io)?),
ImapDeleteResult::Ok { .. } => break,
ImapDeleteResult::Err { err, .. } => bail!(err),
}
+2 -2
View File
@@ -29,7 +29,7 @@ impl ExpungeMailboxCommand {
let context = loop {
match coroutine.resume(arg.take()) {
ImapSelectResult::Io(io) => arg = Some(handle(&mut stream, io)?),
ImapSelectResult::Io { io } => arg = Some(handle(&mut stream, io)?),
ImapSelectResult::Ok { context, .. } => break context,
ImapSelectResult::Err { err, .. } => bail!(err),
}
@@ -41,7 +41,7 @@ impl ExpungeMailboxCommand {
loop {
match coroutine.resume(arg.take()) {
ImapExpungeResult::Io(io) => arg = Some(handle(&mut stream, io)?),
ImapExpungeResult::Io { io } => arg = Some(handle(&mut stream, io)?),
ImapExpungeResult::Ok { .. } => break,
ImapExpungeResult::Err { err, .. } => bail!(err),
}
+2 -2
View File
@@ -34,7 +34,7 @@ impl ListMailboxesCommand {
loop {
match coroutine.resume(arg.take()) {
ImapListResult::Io(io) => arg = Some(handle(&mut stream, io)?),
ImapListResult::Io { io } => arg = Some(handle(&mut stream, io)?),
ImapListResult::Ok { mailboxes, .. } => break mailboxes,
ImapListResult::Err { err, .. } => bail!(err),
}
@@ -46,7 +46,7 @@ impl ListMailboxesCommand {
loop {
match coroutine.resume(arg.take()) {
ImapLsubResult::Io(io) => arg = Some(handle(&mut stream, io)?),
ImapLsubResult::Io { io } => arg = Some(handle(&mut stream, io)?),
ImapLsubResult::Ok { mailboxes, .. } => break mailboxes,
ImapLsubResult::Err { err, .. } => bail!(err),
}
+3 -3
View File
@@ -34,7 +34,7 @@ impl PurgeMailboxCommand {
let context = loop {
match coroutine.resume(arg.take()) {
ImapSelectResult::Io(io) => arg = Some(handle(&mut stream, io)?),
ImapSelectResult::Io { io } => arg = Some(handle(&mut stream, io)?),
ImapSelectResult::Ok { context, .. } => break context,
ImapSelectResult::Err { err, .. } => bail!(err),
}
@@ -53,7 +53,7 @@ impl PurgeMailboxCommand {
let context = loop {
match coroutine.resume(arg.take()) {
ImapStoreSilentResult::Io(io) => arg = Some(handle(&mut stream, io)?),
ImapStoreSilentResult::Io { io } => arg = Some(handle(&mut stream, io)?),
ImapStoreSilentResult::Ok { context, .. } => break context,
ImapStoreSilentResult::Err { err, .. } => bail!(err),
}
@@ -65,7 +65,7 @@ impl PurgeMailboxCommand {
loop {
match coroutine.resume(arg.take()) {
ImapExpungeResult::Io(io) => arg = Some(handle(&mut stream, io)?),
ImapExpungeResult::Io { io } => arg = Some(handle(&mut stream, io)?),
ImapExpungeResult::Ok { .. } => break,
ImapExpungeResult::Err { err, .. } => bail!(err),
}
+1 -1
View File
@@ -34,7 +34,7 @@ impl RenameMailboxCommand {
loop {
match coroutine.resume(arg.take()) {
ImapRenameResult::Io(io) => arg = Some(handle(&mut stream, io)?),
ImapRenameResult::Io { io } => arg = Some(handle(&mut stream, io)?),
ImapRenameResult::Ok { .. } => break,
ImapRenameResult::Err { err, .. } => bail!(err),
}
+1 -1
View File
@@ -39,7 +39,7 @@ impl StatusMailboxCommand {
let items = loop {
match coroutine.resume(arg.take()) {
ImapStatusResult::Io(io) => arg = Some(handle(&mut stream, io)?),
ImapStatusResult::Io { io } => arg = Some(handle(&mut stream, io)?),
ImapStatusResult::Ok { items, .. } => break items,
ImapStatusResult::Err { err, .. } => bail!(err),
}
+1 -1
View File
@@ -27,7 +27,7 @@ impl SubscribeMailboxCommand {
loop {
match coroutine.resume(arg.take()) {
ImapSubscribeResult::Io(io) => arg = Some(handle(&mut stream, io)?),
ImapSubscribeResult::Io { io } => arg = Some(handle(&mut stream, io)?),
ImapSubscribeResult::Ok { .. } => break,
ImapSubscribeResult::Err { err, .. } => bail!(err),
}
+2 -2
View File
@@ -28,7 +28,7 @@ impl UnselectMailboxCommand {
let context = loop {
match select_coroutine.resume(arg.take()) {
ImapSelectResult::Io(io) => arg = Some(handle(&mut stream, io)?),
ImapSelectResult::Io { io } => arg = Some(handle(&mut stream, io)?),
ImapSelectResult::Ok { context, .. } => break context,
ImapSelectResult::Err { err, .. } => bail!(err),
}
@@ -40,7 +40,7 @@ impl UnselectMailboxCommand {
loop {
match unselect_coroutine.resume(arg.take()) {
ImapUnselectResult::Io(io) => arg = Some(handle(&mut stream, io)?),
ImapUnselectResult::Io { io } => arg = Some(handle(&mut stream, io)?),
ImapUnselectResult::Ok { .. } => break,
ImapUnselectResult::Err { err, .. } => bail!(err),
}
+1 -1
View File
@@ -27,7 +27,7 @@ impl UnsubscribeMailboxCommand {
loop {
match coroutine.resume(arg.take()) {
ImapUnsubscribeResult::Io(io) => arg = Some(handle(&mut stream, io)?),
ImapUnsubscribeResult::Io { io } => arg = Some(handle(&mut stream, io)?),
ImapUnsubscribeResult::Ok { .. } => break,
ImapUnsubscribeResult::Err { err, .. } => bail!(err),
}
+6 -6
View File
@@ -96,7 +96,7 @@ pub fn connect(mut config: ImapConfig) -> Result<(ImapContext, Stream)> {
loop {
match coroutine.resume(arg.take()) {
GetImapGreetingWithCapabilityResult::Io(io) => {
GetImapGreetingWithCapabilityResult::Io { io } => {
arg = Some(handle(&mut stream, io)?)
}
GetImapGreetingWithCapabilityResult::Ok { context: c } => break context = c,
@@ -116,7 +116,7 @@ pub fn connect(mut config: ImapConfig) -> Result<(ImapContext, Stream)> {
loop {
match coroutine.resume(arg.take()) {
ImapStartTlsResult::Io(io) => arg = Some(handle(&mut stream, io)?),
ImapStartTlsResult::Io { io } => arg = Some(handle(&mut stream, io)?),
ImapStartTlsResult::Ok { context: c } => break context = c,
ImapStartTlsResult::Err { err, .. } => Err(err)?,
}
@@ -247,7 +247,7 @@ pub fn connect(mut config: ImapConfig) -> Result<(ImapContext, Stream)> {
loop {
match coroutine.resume(arg.take()) {
GetImapCapabilityResult::Io(io) => arg = Some(handle(&mut stream, io)?),
GetImapCapabilityResult::Io { io } => arg = Some(handle(&mut stream, io)?),
GetImapCapabilityResult::Ok { context: c } => break context = c,
GetImapCapabilityResult::Err { err, .. } => Err(err)?,
}
@@ -258,7 +258,7 @@ pub fn connect(mut config: ImapConfig) -> Result<(ImapContext, Stream)> {
loop {
match coroutine.resume(arg.take()) {
GetImapGreetingWithCapabilityResult::Io(io) => {
GetImapGreetingWithCapabilityResult::Io { io } => {
arg = Some(handle(&mut stream, io)?)
}
GetImapGreetingWithCapabilityResult::Ok { context: c } => {
@@ -280,7 +280,7 @@ pub fn connect(mut config: ImapConfig) -> Result<(ImapContext, Stream)> {
loop {
match coroutine.resume(arg.take()) {
GetImapGreetingWithCapabilityResult::Io(io) => {
GetImapGreetingWithCapabilityResult::Io { io } => {
arg = Some(handle(&mut stream, io)?)
}
GetImapGreetingWithCapabilityResult::Ok { context: c } => break context = c,
@@ -367,7 +367,7 @@ pub fn connect(mut config: ImapConfig) -> Result<(ImapContext, Stream)> {
loop {
match coroutine.resume(arg.take()) {
ImapAuthenticateResult::Io(io) => arg = Some(handle(&mut stream, io)?),
ImapAuthenticateResult::Io { io } => arg = Some(handle(&mut stream, io)?),
ImapAuthenticateResult::Ok { context: c, .. } => break context = c,
ImapAuthenticateResult::Err { err, .. } => bail!(err),
}