From c56511fa1e4ac42886f2736fe73729eb8f18a224 Mon Sep 17 00:00:00 2001 From: Nbiba Bedis Date: Sat, 27 Jul 2024 09:04:16 +0100 Subject: [PATCH] update ipynb examples --- crates/irust_repl/irust_kernel/evcxr.ipynb | 14 +- crates/irust_repl/irust_kernel/irust.ipynb | 149 ++++++++++++++------- 2 files changed, 108 insertions(+), 55 deletions(-) diff --git a/crates/irust_repl/irust_kernel/evcxr.ipynb b/crates/irust_repl/irust_kernel/evcxr.ipynb index 18afad47..cc83532a 100644 --- a/crates/irust_repl/irust_kernel/evcxr.ipynb +++ b/crates/irust_repl/irust_kernel/evcxr.ipynb @@ -2,10 +2,13 @@ "cells": [ { "cell_type": "code", - "execution_count": 2, + "execution_count": 1, "id": "2ed08531-0851-4cd0-97c8-a11f70058136", "metadata": { - "tags": [] + "tags": [], + "vscode": { + "languageId": "rust" + } }, "outputs": [], "source": [ @@ -17,7 +20,10 @@ "execution_count": 4, "id": "798a5e69-b290-4f26-a711-f28fafa4dab8", "metadata": { - "tags": [] + "tags": [], + "vscode": { + "languageId": "rust" + } }, "outputs": [ { @@ -319,7 +325,7 @@ "metadata": { "kernelspec": { "display_name": "IRust", - "language": "bash", + "language": "rust", "name": "irust" }, "language_info": { diff --git a/crates/irust_repl/irust_kernel/irust.ipynb b/crates/irust_repl/irust_kernel/irust.ipynb index 3127139d..9292c0c2 100644 --- a/crates/irust_repl/irust_kernel/irust.ipynb +++ b/crates/irust_repl/irust_kernel/irust.ipynb @@ -2,16 +2,22 @@ "cells": [ { "cell_type": "code", - "execution_count": 2, + "execution_count": 1, "id": "590f518b-4353-45e8-ae65-355db93810a2", - "metadata": {}, + "metadata": { + "vscode": { + "languageId": "rust" + } + }, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "9\n" - ] + "data": { + "text/plain": [ + "9" + ] + }, + "metadata": {}, + "output_type": "display_data" } ], "source": [ @@ -20,9 +26,13 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 2, "id": "926722e2-df56-4547-adf3-916ec5bc2c50", - "metadata": {}, + "metadata": { + "vscode": { + "languageId": "rust" + } + }, "outputs": [], "source": [ "let a = \"hello\";" @@ -30,16 +40,22 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 3, "id": "dae7e4f4-1c40-448c-af79-bf9497e5294b", - "metadata": {}, + "metadata": { + "vscode": { + "languageId": "rust" + } + }, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "Chars(['h', 'e', 'l', 'l', 'o'])\n" - ] + "data": { + "text/plain": [ + "Chars(['h', 'e', 'l', 'l', 'o'])" + ] + }, + "metadata": {}, + "output_type": "display_data" } ], "source": [ @@ -48,9 +64,13 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 4, "id": "b25222a2-c755-4d5a-b5c5-21dc4c65e7f8", - "metadata": {}, + "metadata": { + "vscode": { + "languageId": "rust" + } + }, "outputs": [], "source": [ ":add regex" @@ -58,16 +78,22 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 5, "id": "c2c8b56a-e2d1-42a0-8572-3d0d1503c7ab", - "metadata": {}, + "metadata": { + "vscode": { + "languageId": "rust" + } + }, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "true\n" - ] + "data": { + "text/plain": [ + "true" + ] + }, + "metadata": {}, + "output_type": "display_data" } ], "source": [ @@ -76,47 +102,68 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 6, "id": "c658b87b-7a97-44a6-ac6f-7eb47243bdd4", - "metadata": {}, + "metadata": { + "vscode": { + "languageId": "rust" + } + }, "outputs": [ { - "name": "stdout", - "output_type": "stream", - "text": [ - "\u001b[0m\u001b[0m\u001b[1m\u001b[36m Blocking\u001b[0m waiting for file lock on build directory\n", - "\u001b[0m\u001b[0m\u001b[1m\u001b[32m Compiling\u001b[0m irust_host_repl v0.1.0 (/tmp/irust_host_repl)\n", - "\u001b[0m\u001b[1m\u001b[38;5;9merror[E0369]\u001b[0m\u001b[0m\u001b[1m: cannot add `{integer}` to `&str`\u001b[0m\n", - "\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/main.rs:3:19\u001b[0m\n", - "\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n", - "\u001b[0m\u001b[1m\u001b[38;5;12m3\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0mlet a = \"hello\";a + 1\u001b[0m\n", - "\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m-\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9m^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m-\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m{integer}\u001b[0m\n", - "\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n", - "\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m&str\u001b[0m\n", - "\n", - "\u001b[0m\u001b[1m\u001b[38;5;9merror\u001b[0m\u001b[0m\u001b[1m: aborting due to previous error\u001b[0m\n", - "\n", - "\u001b[0m\u001b[1mFor more information about this error, try `rustc --explain E0369`.\u001b[0m\n", - "\u001b[0m\u001b[0m\u001b[1m\u001b[31merror\u001b[0m\u001b[1m:\u001b[0m could not compile `irust_host_repl`\n", - "\n", - "To learn more, run the command again with --verbose.\n" - ] + "data": { + "text/plain": [ + "\u001b[0m\u001b[1m\u001b[38;5;9merror[E0369]\u001b[0m\u001b[0m\u001b[1m: cannot add `{integer}` to `&str`\u001b[0m\n", + "\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/main.rs:4:3\u001b[0m\n", + "\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n", + "\u001b[0m\u001b[1m\u001b[38;5;12m4\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0ma + 1\u001b[0m\n", + "\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m-\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9m^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m-\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m{integer}\u001b[0m\n", + "\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n", + "\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m&str\u001b[0m\n" + ] + }, + "metadata": {}, + "output_type": "display_data" } ], "source": [ "a + 1" ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "0d15ad22", + "metadata": { + "vscode": { + "languageId": "rust" + } + }, + "outputs": [ + { + "data": { + "text/plain": [ + "Ok(Regex(\"aze\"))" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], + "source": [ + "regex::Regex::new(\"aze\")" + ] } ], "metadata": { "kernelspec": { - "display_name": "IRustKernel", - "language": "", - "name": "irustkernel" + "display_name": "IRust", + "language": "rust", + "name": "irust" }, "language_info": { "file_extension": ".rs", - "mimetype": "text/plain", + "mimetype": "text/x-rust", "name": "IRust" } },