From e1dc46b075f4a89336d86360f40e531c5fbb37ff Mon Sep 17 00:00:00 2001 From: Quarto GHA Workflow Runner Date: Sun, 1 Dec 2024 20:31:39 +0000 Subject: [PATCH] Built site for gh-pages --- .nojekyll | 2 +- index.html | 15 +- search.json | 228 ++++++-- ...p-4c2f708ee8531cb07d7a3b1c42bf6dda.min.css | 12 + ...k-a71619196f4f5e4e93c7baa22a6c2c91.min.css | 12 + site_libs/bootstrap/bootstrap-dark.min.css | 12 - site_libs/bootstrap/bootstrap.min.css | 12 - site_libs/quarto-html/quarto-html.min.css | 1 - ...dark-d166b450ba5a8e9f7a0ab969bf6592c1.css} | 2 +- ...ting-e26003cea8cd680ca0c55a263523d882.css} | 2 +- site_libs/quarto-html/quarto.js | 5 +- site_libs/revealjs/dist/reveal.css | 6 +- site_libs/revealjs/dist/reveal.esm.js | 6 +- site_libs/revealjs/dist/reveal.esm.js.map | 2 +- site_libs/revealjs/dist/reveal.js | 6 +- site_libs/revealjs/dist/reveal.js.map | 2 +- ...uarto-f77ede3f8df5db7b2f50cc1693ca0955.css | 8 + site_libs/revealjs/dist/theme/quarto.css | 8 - .../plugin/highlight/highlight.esm.js | 4 +- .../revealjs/plugin/highlight/highlight.js | 8 +- site_libs/revealjs/plugin/highlight/plugin.js | 4 +- .../revealjs/plugin/markdown/markdown.esm.js | 8 +- .../revealjs/plugin/markdown/markdown.js | 8 +- site_libs/revealjs/plugin/markdown/plugin.js | 112 ++-- site_libs/revealjs/plugin/math/math.esm.js | 7 +- site_libs/revealjs/plugin/math/math.js | 2 +- site_libs/revealjs/plugin/math/mathjax3.js | 4 +- site_libs/revealjs/plugin/notes/notes.esm.js | 2 +- site_libs/revealjs/plugin/notes/notes.js | 2 +- site_libs/revealjs/plugin/notes/plugin.js | 59 ++- .../revealjs/plugin/notes/speaker-view.html | 36 +- .../revealjs/plugin/pdf-export/pdfexport.js | 12 +- .../quarto-line-highlight/line-highlight.js | 2 +- .../revealjs/plugin/quarto-support/support.js | 103 +++- .../plugin/reveal-menu/quarto-menu.js | 3 + site_libs/revealjs/plugin/search/plugin.js | 2 +- .../revealjs/plugin/search/search.esm.js | 4 +- site_libs/revealjs/plugin/search/search.js | 4 +- site_libs/revealjs/plugin/zoom/zoom.esm.js | 9 +- site_libs/revealjs/plugin/zoom/zoom.js | 9 +- sitemap.xml | 48 +- slides/00-club-intro.html | 222 +------- slides/00-intro.html | 222 +------- slides/01-getting_started.html | 222 +------- slides/02-programming_a_guessing_game.html | 222 +------- slides/03-common_programming_concepts.html | 224 +------- slides/04-understanding_ownership.html | 222 +------- ...ing_structs_to_structure_related_data.html | 222 +------- slides/06-enums_and_pattern_matching.html | 222 +------- ...ects_with_packages_crates_and_modules.html | 441 ++++++++-------- slides/08-common_collections.html | 222 +------- slides/09-error_handling.html | 222 +------- ...10-generic_types_traits_and_lifetimes.html | 222 +------- slides/11-writing_automated_tests.html | 222 +------- ...oject_building_a_command_line_program.html | 222 +------- ...guage_features_iterators_and_closures.html | 222 +------- slides/14-more_about_cargo_and_cratesio.html | 491 +++++++++--------- slides/15-smart_pointers.html | 222 +------- slides/16-fearless_concurrency.html | 222 +------- ...oriented_programming_features_of_rust.html | 222 +------- slides/18-patterns_and_matching.html | 222 +------- slides/19-advanced_features.html | 222 +------- ...t_building_a_multithreaded_web_server.html | 222 +------- slides/21-appendix.html | 222 +------- 64 files changed, 1235 insertions(+), 5154 deletions(-) create mode 100644 site_libs/bootstrap/bootstrap-4c2f708ee8531cb07d7a3b1c42bf6dda.min.css create mode 100644 site_libs/bootstrap/bootstrap-dark-a71619196f4f5e4e93c7baa22a6c2c91.min.css delete mode 100644 site_libs/bootstrap/bootstrap-dark.min.css delete mode 100644 site_libs/bootstrap/bootstrap.min.css delete mode 100644 site_libs/quarto-html/quarto-html.min.css rename site_libs/quarto-html/{quarto-syntax-highlighting-dark.css => quarto-syntax-highlighting-dark-d166b450ba5a8e9f7a0ab969bf6592c1.css} (97%) rename site_libs/quarto-html/{quarto-syntax-highlighting.css => quarto-syntax-highlighting-e26003cea8cd680ca0c55a263523d882.css} (97%) create mode 100644 site_libs/revealjs/dist/theme/quarto-f77ede3f8df5db7b2f50cc1693ca0955.css delete mode 100644 site_libs/revealjs/dist/theme/quarto.css diff --git a/.nojekyll b/.nojekyll index 8025a40..4968a25 100644 --- a/.nojekyll +++ b/.nojekyll @@ -1 +1 @@ -0c1b0ac2 \ No newline at end of file +fd697cec \ No newline at end of file diff --git a/index.html b/index.html index ab15ce2..c4992a9 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@ - + @@ -35,12 +35,12 @@ - - + + - - + + ' ); - var leadingWs = text.match( /^\n?(\s*)/ )[1].length, + const leadingWs = text.match( /^\n?(\s*)/ )[1].length, leadingTabs = text.match( /^\n?(\t*)/ )[1].length; if( leadingTabs > 0 ) { - text = text.replace( new RegExp('\\n?\\t{' + leadingTabs + '}','g'), '\n' ); + text = text.replace( new RegExp('\\n?\\t{' + leadingTabs + '}(.*)','g'), function(m, p1) { return '\n' + p1 ; } ); } else if( leadingWs > 1 ) { - text = text.replace( new RegExp('\\n? {' + leadingWs + '}', 'g'), '\n' ); + text = text.replace( new RegExp('\\n? {' + leadingWs + '}(.*)', 'g'), function(m, p1) { return '\n' + p1 ; } ); } return text; @@ -65,11 +68,11 @@ const Plugin = () => { */ function getForwardedAttributes( section ) { - var attributes = section.attributes; - var result = []; + const attributes = section.attributes; + const result = []; - for( var i = 0, len = attributes.length; i < len; i++ ) { - var name = attributes[i].name, + for( let i = 0, len = attributes.length; i < len; i++ ) { + const name = attributes[i].name, value = attributes[i].value; // disregard attributes that are used for markdown loading/parsing @@ -92,10 +95,12 @@ const Plugin = () => { * values for what's not defined. */ function getSlidifyOptions( options ) { + const markdownConfig = deck?.getConfig?.().markdown; options = options || {}; - options.separator = options.separator || DEFAULT_SLIDE_SEPARATOR; - options.notesSeparator = options.notesSeparator || DEFAULT_NOTES_SEPARATOR; + options.separator = options.separator || markdownConfig?.separator || DEFAULT_SLIDE_SEPARATOR; + options.verticalSeparator = options.verticalSeparator || markdownConfig?.verticalSeparator || DEFAULT_VERTICAL_SEPARATOR; + options.notesSeparator = options.notesSeparator || markdownConfig?.notesSeparator || DEFAULT_NOTES_SEPARATOR; options.attributes = options.attributes || ''; return options; @@ -109,7 +114,7 @@ const Plugin = () => { options = getSlidifyOptions( options ); - var notesMatch = content.split( new RegExp( options.notesSeparator, 'mgi' ) ); + const notesMatch = content.split( new RegExp( options.notesSeparator, 'mgi' ) ); if( notesMatch.length === 2 ) { content = notesMatch[0] + ''; @@ -131,10 +136,10 @@ const Plugin = () => { options = getSlidifyOptions( options ); - var separatorRegex = new RegExp( options.separator + ( options.verticalSeparator ? '|' + options.verticalSeparator : '' ), 'mg' ), + const separatorRegex = new RegExp( options.separator + ( options.verticalSeparator ? '|' + options.verticalSeparator : '' ), 'mg' ), horizontalSeparatorRegex = new RegExp( options.separator ); - var matches, + let matches, lastIndex = 0, isHorizontal, wasHorizontal = true, @@ -143,7 +148,7 @@ const Plugin = () => { // iterate until all blocks between separators are stacked up while( matches = separatorRegex.exec( markdown ) ) { - var notes = null; + const notes = null; // determine direction (horizontal by default) isHorizontal = horizontalSeparatorRegex.test( matches[0] ); @@ -172,10 +177,10 @@ const Plugin = () => { // add the remaining slide ( wasHorizontal ? sectionStack : sectionStack[sectionStack.length-1] ).push( markdown.substring( lastIndex ) ); - var markdownSections = ''; + let markdownSections = ''; // flatten the hierarchical stack, and insert
tags - for( var i = 0, len = sectionStack.length; i < len; i++ ) { + for( let i = 0, len = sectionStack.length; i < len; i++ ) { // vertical if( sectionStack[i] instanceof Array ) { markdownSections += '
'; @@ -204,7 +209,7 @@ const Plugin = () => { return new Promise( function( resolve ) { - var externalPromises = []; + const externalPromises = []; [].slice.call( scope.querySelectorAll( 'section[data-markdown]:not([data-markdown-parsed])') ).forEach( function( section, i ) { @@ -257,13 +262,13 @@ const Plugin = () => { return new Promise( function( resolve, reject ) { - var xhr = new XMLHttpRequest(), + const xhr = new XMLHttpRequest(), url = section.getAttribute( 'data-markdown' ); - var datacharset = section.getAttribute( 'data-charset' ); + const datacharset = section.getAttribute( 'data-charset' ); // see https://developer.mozilla.org/en-US/docs/Web/API/element.getAttribute#Notes - if( datacharset != null && datacharset != '' ) { + if( datacharset !== null && datacharset !== '' ) { xhr.overrideMimeType( 'text/html; charset=' + datacharset ); } @@ -308,17 +313,17 @@ const Plugin = () => { */ function addAttributeInElement( node, elementTarget, separator ) { - var mardownClassesInElementsRegex = new RegExp( separator, 'mg' ); - var mardownClassRegex = new RegExp( "([^\"= ]+?)=\"([^\"]+?)\"|(data-[^\"= ]+?)(?=[\" ])", 'mg' ); - var nodeValue = node.nodeValue; - var matches, + const markdownClassesInElementsRegex = new RegExp( separator, 'mg' ); + const markdownClassRegex = new RegExp( "([^\"= ]+?)=\"([^\"]+?)\"|(data-[^\"= ]+?)(?=[\" ])", 'mg' ); + let nodeValue = node.nodeValue; + let matches, matchesClass; - if( matches = mardownClassesInElementsRegex.exec( nodeValue ) ) { + if( matches = markdownClassesInElementsRegex.exec( nodeValue ) ) { - var classes = matches[1]; - nodeValue = nodeValue.substring( 0, matches.index ) + nodeValue.substring( mardownClassesInElementsRegex.lastIndex ); + const classes = matches[1]; + nodeValue = nodeValue.substring( 0, matches.index ) + nodeValue.substring( markdownClassesInElementsRegex.lastIndex ); node.nodeValue = nodeValue; - while( matchesClass = mardownClassRegex.exec( classes ) ) { + while( matchesClass = markdownClassRegex.exec( classes ) ) { if( matchesClass[2] ) { elementTarget.setAttribute( matchesClass[1], matchesClass[2] ); } else { @@ -336,34 +341,34 @@ const Plugin = () => { */ function addAttributes( section, element, previousElement, separatorElementAttributes, separatorSectionAttributes ) { - if ( element != null && element.childNodes != undefined && element.childNodes.length > 0 ) { - var previousParentElement = element; - for( var i = 0; i < element.childNodes.length; i++ ) { - var childElement = element.childNodes[i]; + if ( element !== null && element.childNodes !== undefined && element.childNodes.length > 0 ) { + let previousParentElement = element; + for( let i = 0; i < element.childNodes.length; i++ ) { + const childElement = element.childNodes[i]; if ( i > 0 ) { - var j = i - 1; + let j = i - 1; while ( j >= 0 ) { - var aPreviousChildElement = element.childNodes[j]; - if ( typeof aPreviousChildElement.setAttribute == 'function' && aPreviousChildElement.tagName != "BR" ) { + const aPreviousChildElement = element.childNodes[j]; + if ( typeof aPreviousChildElement.setAttribute === 'function' && aPreviousChildElement.tagName !== "BR" ) { previousParentElement = aPreviousChildElement; break; } j = j - 1; } } - var parentSection = section; - if( childElement.nodeName == "section" ) { + let parentSection = section; + if( childElement.nodeName === "section" ) { parentSection = childElement ; previousParentElement = childElement ; } - if ( typeof childElement.setAttribute == 'function' || childElement.nodeType == Node.COMMENT_NODE ) { + if ( typeof childElement.setAttribute === 'function' || childElement.nodeType === Node.COMMENT_NODE ) { addAttributes( parentSection, childElement, previousParentElement, separatorElementAttributes, separatorSectionAttributes ); } } } - if ( element.nodeType == Node.COMMENT_NODE ) { - if ( addAttributeInElement( element, previousElement, separatorElementAttributes ) == false ) { + if ( element.nodeType === Node.COMMENT_NODE ) { + if ( addAttributeInElement( element, previousElement, separatorElementAttributes ) === false ) { addAttributeInElement( element, section, separatorSectionAttributes ); } } @@ -375,14 +380,14 @@ const Plugin = () => { */ function convertSlides() { - var sections = deck.getRevealElement().querySelectorAll( '[data-markdown]:not([data-markdown-parsed])'); + const sections = deck.getRevealElement().querySelectorAll( '[data-markdown]:not([data-markdown-parsed])'); [].slice.call( sections ).forEach( function( section ) { section.setAttribute( 'data-markdown-parsed', true ) - var notes = section.querySelector( 'aside.notes' ); - var markdown = getMarkdownFromSlide( section ); + const notes = section.querySelector( 'aside.notes' ); + const markdown = getMarkdownFromSlide( section ); section.innerHTML = marked( markdown ); addAttributes( section, section, null, section.getAttribute( 'data-element-attributes' ) || @@ -429,14 +434,23 @@ const Plugin = () => { renderer.code = ( code, language ) => { // Off by default + let lineNumberOffset = ''; let lineNumbers = ''; // Users can opt in to show line numbers and highlight // specific lines. // ```javascript [] show line numbers // ```javascript [1,4-8] highlights lines 1 and 4-8 + // optional line number offset: + // ```javascript [25: 1,4-8] start line numbering at 25, + // highlights lines 1 (numbered as 25) and 4-8 (numbered as 28-32) if( CODE_LINE_NUMBER_REGEX.test( language ) ) { - lineNumbers = language.match( CODE_LINE_NUMBER_REGEX )[1].trim(); + let lineNumberOffsetMatch = language.match( CODE_LINE_NUMBER_REGEX )[2]; + if (lineNumberOffsetMatch){ + lineNumberOffset = `data-ln-start-from="${lineNumberOffsetMatch.trim()}"`; + } + + lineNumbers = language.match( CODE_LINE_NUMBER_REGEX )[3].trim(); lineNumbers = `data-line-numbers="${lineNumbers}"`; language = language.replace( CODE_LINE_NUMBER_REGEX, '' ).trim(); } @@ -446,7 +460,9 @@ const Plugin = () => { // highlight.js is able to read it code = escapeForHTML( code ); - return `
${code}
`; + // return `
${code}
`; + + return `
${code}
`; }; } diff --git a/site_libs/revealjs/plugin/math/math.esm.js b/site_libs/revealjs/plugin/math/math.esm.js index a0d1468..55c07a0 100644 --- a/site_libs/revealjs/plugin/math/math.esm.js +++ b/site_libs/revealjs/plugin/math/math.esm.js @@ -1 +1,6 @@ -var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},e=function(t){return t&&t.Math==Math&&t},n=e("object"==typeof globalThis&&globalThis)||e("object"==typeof window&&window)||e("object"==typeof self&&self)||e("object"==typeof t&&t)||function(){return this}()||Function("return this")(),r={},o=function(t){try{return!!t()}catch(t){return!0}},i=!o((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),a={},c={}.propertyIsEnumerable,u=Object.getOwnPropertyDescriptor,f=u&&!c.call({1:2},1);a.f=f?function(t){var e=u(this,t);return!!e&&e.enumerable}:c;var s=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},l={}.toString,p=function(t){return l.call(t).slice(8,-1)},h=p,v="".split,d=o((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==h(t)?v.call(t,""):Object(t)}:Object,y=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},g=d,m=y,b=function(t){return g(m(t))},w=function(t){return"object"==typeof t?null!==t:"function"==typeof t},j=w,x=function(t,e){if(!j(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!j(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!j(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!j(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},O=y,E=function(t){return Object(O(t))},S=E,T={}.hasOwnProperty,P=function(t,e){return T.call(S(t),e)},_=w,k=n.document,L=_(k)&&_(k.createElement),M=function(t){return L?k.createElement(t):{}},A=M,I=!i&&!o((function(){return 7!=Object.defineProperty(A("div"),"a",{get:function(){return 7}}).a})),R=i,C=a,N=s,F=b,J=x,D=P,$=I,G=Object.getOwnPropertyDescriptor;r.f=R?G:function(t,e){if(t=F(t),e=J(e,!0),$)try{return G(t,e)}catch(t){}if(D(t,e))return N(!C.f.call(t,e),t[e])};var H={},z=w,W=function(t){if(!z(t))throw TypeError(String(t)+" is not an object");return t},q=i,U=I,K=W,Q=x,X=Object.defineProperty;H.f=q?X:function(t,e,n){if(K(t),e=Q(e,!0),K(n),U)try{return X(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t};var Y=H,B=s,V=i?function(t,e,n){return Y.f(t,e,B(1,n))}:function(t,e,n){return t[e]=n,t},Z={exports:{}},tt=n,et=V,nt=function(t,e){try{et(tt,t,e)}catch(n){tt[t]=e}return e},rt=nt,ot=n["__core-js_shared__"]||rt("__core-js_shared__",{}),it=ot,at=Function.toString;"function"!=typeof it.inspectSource&&(it.inspectSource=function(t){return at.call(t)});var ct=it.inspectSource,ut=ct,ft=n.WeakMap,st="function"==typeof ft&&/native code/.test(ut(ft)),lt={exports:{}},pt=ot;(lt.exports=function(t,e){return pt[t]||(pt[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.12.1",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"});var ht,vt,dt,yt=0,gt=Math.random(),mt=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++yt+gt).toString(36)},bt=lt.exports,wt=mt,jt=bt("keys"),xt=function(t){return jt[t]||(jt[t]=wt(t))},Ot={},Et=st,St=w,Tt=V,Pt=P,_t=ot,kt=xt,Lt=Ot,Mt=n.WeakMap;if(Et||_t.state){var At=_t.state||(_t.state=new Mt),It=At.get,Rt=At.has,Ct=At.set;ht=function(t,e){if(Rt.call(At,t))throw new TypeError("Object already initialized");return e.facade=t,Ct.call(At,t,e),e},vt=function(t){return It.call(At,t)||{}},dt=function(t){return Rt.call(At,t)}}else{var Nt=kt("state");Lt[Nt]=!0,ht=function(t,e){if(Pt(t,Nt))throw new TypeError("Object already initialized");return e.facade=t,Tt(t,Nt,e),e},vt=function(t){return Pt(t,Nt)?t[Nt]:{}},dt=function(t){return Pt(t,Nt)}}var Ft={set:ht,get:vt,has:dt,enforce:function(t){return dt(t)?vt(t):ht(t,{})},getterFor:function(t){return function(e){var n;if(!St(e)||(n=vt(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}},Jt=n,Dt=V,$t=P,Gt=nt,Ht=ct,zt=Ft.get,Wt=Ft.enforce,qt=String(String).split("String");(Z.exports=function(t,e,n,r){var o,i=!!r&&!!r.unsafe,a=!!r&&!!r.enumerable,c=!!r&&!!r.noTargetGet;"function"==typeof n&&("string"!=typeof e||$t(n,"name")||Dt(n,"name",e),(o=Wt(n)).source||(o.source=qt.join("string"==typeof e?e:""))),t!==Jt?(i?!c&&t[e]&&(a=!0):delete t[e],a?t[e]=n:Dt(t,e,n)):a?t[e]=n:Gt(e,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&zt(this).source||Ht(this)}));var Ut=n,Kt=n,Qt=function(t){return"function"==typeof t?t:void 0},Xt=function(t,e){return arguments.length<2?Qt(Ut[t])||Qt(Kt[t]):Ut[t]&&Ut[t][e]||Kt[t]&&Kt[t][e]},Yt={},Bt=Math.ceil,Vt=Math.floor,Zt=function(t){return isNaN(t=+t)?0:(t>0?Vt:Bt)(t)},te=Zt,ee=Math.min,ne=function(t){return t>0?ee(te(t),9007199254740991):0},re=Zt,oe=Math.max,ie=Math.min,ae=b,ce=ne,ue=function(t,e){var n=re(t);return n<0?oe(n+e,0):ie(n,e)},fe=function(t){return function(e,n,r){var o,i=ae(e),a=ce(i.length),c=ue(r,a);if(t&&n!=n){for(;a>c;)if((o=i[c++])!=o)return!0}else for(;a>c;c++)if((t||c in i)&&i[c]===n)return t||c||0;return!t&&-1}},se={includes:fe(!0),indexOf:fe(!1)},le=P,pe=b,he=se.indexOf,ve=Ot,de=function(t,e){var n,r=pe(t),o=0,i=[];for(n in r)!le(ve,n)&&le(r,n)&&i.push(n);for(;e.length>o;)le(r,n=e[o++])&&(~he(i,n)||i.push(n));return i},ye=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ge=de,me=ye.concat("length","prototype");Yt.f=Object.getOwnPropertyNames||function(t){return ge(t,me)};var be={};be.f=Object.getOwnPropertySymbols;var we=Yt,je=be,xe=W,Oe=Xt("Reflect","ownKeys")||function(t){var e=we.f(xe(t)),n=je.f;return n?e.concat(n(t)):e},Ee=P,Se=Oe,Te=r,Pe=H,_e=o,ke=/#|\.prototype\./,Le=function(t,e){var n=Ae[Me(t)];return n==Re||n!=Ie&&("function"==typeof e?_e(e):!!e)},Me=Le.normalize=function(t){return String(t).replace(ke,".").toLowerCase()},Ae=Le.data={},Ie=Le.NATIVE="N",Re=Le.POLYFILL="P",Ce=Le,Ne=n,Fe=r.f,Je=V,De=Z.exports,$e=nt,Ge=function(t,e){for(var n=Se(e),r=Pe.f,o=Te.f,i=0;io;)for(var c,u=Ze(arguments[o++]),f=i?Xe(u).concat(i(u)):Xe(u),s=f.length,l=0;s>l;)c=f[l++],Ke&&!a.call(u,c)||(n[c]=u[c]);return n}:tn;function rn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function on(t){for(var e=1;e=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}function sn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){c=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw i}}}}ze({target:"Object",stat:!0,forced:Object.assign!==nn},{assign:nn});!function(t){var e=function(t){var e,n=Object.prototype,r=n.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function(t,e,n){return t[e]=n}}function f(t,e,n,r){var o=e&&e.prototype instanceof y?e:y,i=Object.create(o.prototype),a=new _(r||[]);return i._invoke=function(t,e,n){var r=l;return function(o,i){if(r===h)throw new Error("Generator is already running");if(r===v){if("throw"===o)throw i;return L()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=S(a,n);if(c){if(c===d)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===l)throw r=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=h;var u=s(t,e,n);if("normal"===u.type){if(r=n.done?v:p,u.arg===d)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=v,n.method="throw",n.arg=u.arg)}}}(t,n,a),i}function s(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=f;var l="suspendedStart",p="suspendedYield",h="executing",v="completed",d={};function y(){}function g(){}function m(){}var b={};b[i]=function(){return this};var w=Object.getPrototypeOf,j=w&&w(w(k([])));j&&j!==n&&r.call(j,i)&&(b=j);var x=m.prototype=y.prototype=Object.create(b);function O(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function E(t,e){function n(o,i,a,c){var u=s(t[o],t,i);if("throw"!==u.type){var f=u.arg,l=f.value;return l&&"object"==typeof l&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,a,c)}),(function(t){n("throw",t,a,c)})):e.resolve(l).then((function(t){f.value=t,a(f)}),(function(t){return n("throw",t,a,c)}))}c(u.arg)}var o;this._invoke=function(t,r){function i(){return new e((function(e,o){n(t,r,e,o)}))}return o=o?o.then(i,i):i()}}function S(t,n){var r=t.iterator[n.method];if(r===e){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=e,S(t,n),"throw"===n.method))return d;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var o=s(r,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,d;var i=o.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,d):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,d)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function P(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function _(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function k(t){if(t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),f=r.call(a,"finallyLoc");if(u&&f){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),P(n),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:k(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),d}},t}(t.exports);try{regeneratorRuntime=e}catch(t){Function("r","regeneratorRuntime = r")(e)}}({exports:{}});var pn,hn,vn=Xt("navigator","userAgent")||"",dn=vn,yn=n.process,gn=yn&&yn.versions,mn=gn&&gn.v8;mn?hn=(pn=mn.split("."))[0]<4?1:pn[0]+pn[1]:dn&&(!(pn=dn.match(/Edge\/(\d+)/))||pn[1]>=74)&&(pn=dn.match(/Chrome\/(\d+)/))&&(hn=pn[1]);var bn=hn&&+hn,wn=bn,jn=o,xn=!!Object.getOwnPropertySymbols&&!jn((function(){return!String(Symbol())||!Symbol.sham&&wn&&wn<41})),On=xn&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,En=n,Sn=lt.exports,Tn=P,Pn=mt,_n=xn,kn=On,Ln=Sn("wks"),Mn=En.Symbol,An=kn?Mn:Mn&&Mn.withoutSetter||Pn,In=function(t){return Tn(Ln,t)&&(_n||"string"==typeof Ln[t])||(_n&&Tn(Mn,t)?Ln[t]=Mn[t]:Ln[t]=An("Symbol."+t)),Ln[t]},Rn={};Rn[In("toStringTag")]="z";var Cn="[object z]"===String(Rn),Nn=Cn,Fn=p,Jn=In("toStringTag"),Dn="Arguments"==Fn(function(){return arguments}()),$n=Nn?Fn:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),Jn))?n:Dn?Fn(e):"Object"==(r=Fn(e))&&"function"==typeof e.callee?"Arguments":r},Gn=$n,Hn=Cn?{}.toString:function(){return"[object "+Gn(this)+"]"},zn=Cn,Wn=Z.exports,qn=Hn;zn||Wn(Object.prototype,"toString",qn,{unsafe:!0});var Un=n.Promise,Kn=Z.exports,Qn=w,Xn=W,Yn=function(t){if(!Qn(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t},Bn=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),e=n instanceof Array}catch(t){}return function(n,r){return Xn(n),Yn(r),e?t.call(n,r):n.__proto__=r,n}}():void 0),Vn=H.f,Zn=P,tr=In("toStringTag"),er=Xt,nr=H,rr=i,or=In("species"),ir=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t},ar={},cr=ar,ur=In("iterator"),fr=Array.prototype,sr=ir,lr=function(t,e,n){if(sr(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}},pr=$n,hr=ar,vr=In("iterator"),dr=W,yr=W,gr=function(t){return void 0!==t&&(cr.Array===t||fr[ur]===t)},mr=ne,br=lr,wr=function(t){if(null!=t)return t[vr]||t["@@iterator"]||hr[pr(t)]},jr=function(t){var e=t.return;if(void 0!==e)return dr(e.call(t)).value},xr=function(t,e){this.stopped=t,this.result=e},Or=In("iterator"),Er=!1;try{var Sr=0,Tr={next:function(){return{done:!!Sr++}},return:function(){Er=!0}};Tr[Or]=function(){return this},Array.from(Tr,(function(){throw 2}))}catch(t){}var Pr,_r,kr,Lr=W,Mr=ir,Ar=In("species"),Ir=Xt("document","documentElement"),Rr=/(?:iphone|ipod|ipad).*applewebkit/i.test(vn),Cr="process"==p(n.process),Nr=n,Fr=o,Jr=lr,Dr=Ir,$r=M,Gr=Rr,Hr=Cr,zr=Nr.location,Wr=Nr.setImmediate,qr=Nr.clearImmediate,Ur=Nr.process,Kr=Nr.MessageChannel,Qr=Nr.Dispatch,Xr=0,Yr={},Br=function(t){if(Yr.hasOwnProperty(t)){var e=Yr[t];delete Yr[t],e()}},Vr=function(t){return function(){Br(t)}},Zr=function(t){Br(t.data)},to=function(t){Nr.postMessage(t+"",zr.protocol+"//"+zr.host)};Wr&&qr||(Wr=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return Yr[++Xr]=function(){("function"==typeof t?t:Function(t)).apply(void 0,e)},Pr(Xr),Xr},qr=function(t){delete Yr[t]},Hr?Pr=function(t){Ur.nextTick(Vr(t))}:Qr&&Qr.now?Pr=function(t){Qr.now(Vr(t))}:Kr&&!Gr?(kr=(_r=new Kr).port2,_r.port1.onmessage=Zr,Pr=Jr(kr.postMessage,kr,1)):Nr.addEventListener&&"function"==typeof postMessage&&!Nr.importScripts&&zr&&"file:"!==zr.protocol&&!Fr(to)?(Pr=to,Nr.addEventListener("message",Zr,!1)):Pr="onreadystatechange"in $r("script")?function(t){Dr.appendChild($r("script")).onreadystatechange=function(){Dr.removeChild(this),Br(t)}}:function(t){setTimeout(Vr(t),0)});var eo,no,ro,oo,io,ao,co,uo,fo={set:Wr,clear:qr},so=/web0s(?!.*chrome)/i.test(vn),lo=n,po=r.f,ho=fo.set,vo=Rr,yo=so,go=Cr,mo=lo.MutationObserver||lo.WebKitMutationObserver,bo=lo.document,wo=lo.process,jo=lo.Promise,xo=po(lo,"queueMicrotask"),Oo=xo&&xo.value;Oo||(eo=function(){var t,e;for(go&&(t=wo.domain)&&t.exit();no;){e=no.fn,no=no.next;try{e()}catch(t){throw no?oo():ro=void 0,t}}ro=void 0,t&&t.enter()},vo||go||yo||!mo||!bo?jo&&jo.resolve?((co=jo.resolve(void 0)).constructor=jo,uo=co.then,oo=function(){uo.call(co,eo)}):oo=go?function(){wo.nextTick(eo)}:function(){ho.call(lo,eo)}:(io=!0,ao=bo.createTextNode(""),new mo(eo).observe(ao,{characterData:!0}),oo=function(){ao.data=io=!io}));var Eo=Oo||function(t){var e={fn:t,next:void 0};ro&&(ro.next=e),no||(no=e,oo()),ro=e},So={},To=ir,Po=function(t){var e,n;this.promise=new t((function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r})),this.resolve=To(e),this.reject=To(n)};So.f=function(t){return new Po(t)};var _o,ko,Lo,Mo,Ao=W,Io=w,Ro=So,Co=n,No="object"==typeof window,Fo=ze,Jo=n,Do=Xt,$o=Un,Go=Z.exports,Ho=function(t,e,n){for(var r in e)Kn(t,r,e[r],n);return t},zo=Bn,Wo=function(t,e,n){t&&!Zn(t=n?t:t.prototype,tr)&&Vn(t,tr,{configurable:!0,value:e})},qo=function(t){var e=er(t),n=nr.f;rr&&e&&!e[or]&&n(e,or,{configurable:!0,get:function(){return this}})},Uo=w,Ko=ir,Qo=function(t,e,n){if(!(t instanceof e))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return t},Xo=ct,Yo=function(t,e,n){var r,o,i,a,c,u,f,s=n&&n.that,l=!(!n||!n.AS_ENTRIES),p=!(!n||!n.IS_ITERATOR),h=!(!n||!n.INTERRUPTED),v=br(e,s,1+l+h),d=function(t){return r&&jr(r),new xr(!0,t)},y=function(t){return l?(yr(t),h?v(t[0],t[1],d):v(t[0],t[1])):h?v(t,d):v(t)};if(p)r=t;else{if("function"!=typeof(o=wr(t)))throw TypeError("Target is not iterable");if(gr(o)){for(i=0,a=mr(t.length);a>i;i++)if((c=y(t[i]))&&c instanceof xr)return c;return new xr(!1)}r=o.call(t)}for(u=r.next;!(f=u.call(r)).done;){try{c=y(f.value)}catch(t){throw jr(r),t}if("object"==typeof c&&c&&c instanceof xr)return c}return new xr(!1)},Bo=function(t,e){if(!e&&!Er)return!1;var n=!1;try{var r={};r[Or]=function(){return{next:function(){return{done:n=!0}}}},t(r)}catch(t){}return n},Vo=function(t,e){var n,r=Lr(t).constructor;return void 0===r||null==(n=Lr(r)[Ar])?e:Mr(n)},Zo=fo.set,ti=Eo,ei=function(t,e){if(Ao(t),Io(e)&&e.constructor===t)return e;var n=Ro.f(t);return(0,n.resolve)(e),n.promise},ni=function(t,e){var n=Co.console;n&&n.error&&(1===arguments.length?n.error(t):n.error(t,e))},ri=So,oi=function(t){try{return{error:!1,value:t()}}catch(t){return{error:!0,value:t}}},ii=Ft,ai=Ce,ci=No,ui=Cr,fi=bn,si=In("species"),li="Promise",pi=ii.get,hi=ii.set,vi=ii.getterFor(li),di=$o&&$o.prototype,yi=$o,gi=di,mi=Jo.TypeError,bi=Jo.document,wi=Jo.process,ji=ri.f,xi=ji,Oi=!!(bi&&bi.createEvent&&Jo.dispatchEvent),Ei="function"==typeof PromiseRejectionEvent,Si=!1,Ti=ai(li,(function(){var t=Xo(yi)!==String(yi);if(!t&&66===fi)return!0;if(fi>=51&&/native code/.test(yi))return!1;var e=new yi((function(t){t(1)})),n=function(t){t((function(){}),(function(){}))};return(e.constructor={})[si]=n,!(Si=e.then((function(){}))instanceof n)||!t&&ci&&!Ei})),Pi=Ti||!Bo((function(t){yi.all(t).catch((function(){}))})),_i=function(t){var e;return!(!Uo(t)||"function"!=typeof(e=t.then))&&e},ki=function(t,e){if(!t.notified){t.notified=!0;var n=t.reactions;ti((function(){for(var r=t.value,o=1==t.state,i=0;n.length>i;){var a,c,u,f=n[i++],s=o?f.ok:f.fail,l=f.resolve,p=f.reject,h=f.domain;try{s?(o||(2===t.rejection&&Ii(t),t.rejection=1),!0===s?a=r:(h&&h.enter(),a=s(r),h&&(h.exit(),u=!0)),a===f.promise?p(mi("Promise-chain cycle")):(c=_i(a))?c.call(a,l,p):l(a)):p(r)}catch(t){h&&!u&&h.exit(),p(t)}}t.reactions=[],t.notified=!1,e&&!t.rejection&&Mi(t)}))}},Li=function(t,e,n){var r,o;Oi?((r=bi.createEvent("Event")).promise=e,r.reason=n,r.initEvent(t,!1,!0),Jo.dispatchEvent(r)):r={promise:e,reason:n},!Ei&&(o=Jo["on"+t])?o(r):"unhandledrejection"===t&&ni("Unhandled promise rejection",n)},Mi=function(t){Zo.call(Jo,(function(){var e,n=t.facade,r=t.value;if(Ai(t)&&(e=oi((function(){ui?wi.emit("unhandledRejection",r,n):Li("unhandledrejection",n,r)})),t.rejection=ui||Ai(t)?2:1,e.error))throw e.value}))},Ai=function(t){return 1!==t.rejection&&!t.parent},Ii=function(t){Zo.call(Jo,(function(){var e=t.facade;ui?wi.emit("rejectionHandled",e):Li("rejectionhandled",e,t.value)}))},Ri=function(t,e,n){return function(r){t(e,r,n)}},Ci=function(t,e,n){t.done||(t.done=!0,n&&(t=n),t.value=e,t.state=2,ki(t,!0))},Ni=function(t,e,n){if(!t.done){t.done=!0,n&&(t=n);try{if(t.facade===e)throw mi("Promise can't be resolved itself");var r=_i(e);r?ti((function(){var n={done:!1};try{r.call(e,Ri(Ni,n,t),Ri(Ci,n,t))}catch(e){Ci(n,e,t)}})):(t.value=e,t.state=1,ki(t,!1))}catch(e){Ci({done:!1},e,t)}}};if(Ti&&(gi=(yi=function(t){Qo(this,yi,li),Ko(t),_o.call(this);var e=pi(this);try{t(Ri(Ni,e),Ri(Ci,e))}catch(t){Ci(e,t)}}).prototype,(_o=function(t){hi(this,{type:li,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=Ho(gi,{then:function(t,e){var n=vi(this),r=ji(Vo(this,yi));return r.ok="function"!=typeof t||t,r.fail="function"==typeof e&&e,r.domain=ui?wi.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&ki(n,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),ko=function(){var t=new _o,e=pi(t);this.promise=t,this.resolve=Ri(Ni,e),this.reject=Ri(Ci,e)},ri.f=ji=function(t){return t===yi||t===Lo?new ko(t):xi(t)},"function"==typeof $o&&di!==Object.prototype)){Mo=di.then,Si||(Go(di,"then",(function(t,e){var n=this;return new yi((function(t,e){Mo.call(n,t,e)})).then(t,e)}),{unsafe:!0}),Go(di,"catch",gi.catch,{unsafe:!0}));try{delete di.constructor}catch(t){}zo&&zo(di,gi)}Fo({global:!0,wrap:!0,forced:Ti},{Promise:yi}),Wo(yi,li,!1),qo(li),Lo=Do(li),Fo({target:li,stat:!0,forced:Ti},{reject:function(t){var e=ji(this);return e.reject.call(void 0,t),e.promise}}),Fo({target:li,stat:!0,forced:Ti},{resolve:function(t){return ei(this,t)}}),Fo({target:li,stat:!0,forced:Pi},{all:function(t){var e=this,n=ji(e),r=n.resolve,o=n.reject,i=oi((function(){var n=Ko(e.resolve),i=[],a=0,c=1;Yo(t,(function(t){var u=a++,f=!1;i.push(void 0),c++,n.call(e,t).then((function(t){f||(f=!0,i[u]=t,--c||r(i))}),o)})),--c||r(i)}));return i.error&&o(i.value),n.promise},race:function(t){var e=this,n=ji(e),r=n.reject,o=oi((function(){var o=Ko(e.resolve);Yo(t,(function(t){o.call(e,t).then(n.resolve,r)}))}));return o.error&&r(o.value),n.promise}});var Fi,Ji=H,Di=W,$i=Ue,Gi=i?Object.defineProperties:function(t,e){Di(t);for(var n,r=$i(e),o=r.length,i=0;o>i;)Ji.f(t,n=r[i++],e[n]);return t},Hi=W,zi=Gi,Wi=ye,qi=Ot,Ui=Ir,Ki=M,Qi=xt("IE_PROTO"),Xi=function(){},Yi=function(t){return" - - - + + Rust Programming Language Book Club – Club Meetings @@ -29,209 +28,11 @@ vertical-align: middle; } - + - -
+ +
+ + - - - + @@ -474,7 +275,8 @@

Learning objectives (LOs)

'autoAnimateEasing': "ease", 'autoAnimateDuration': 1, 'autoAnimateUnmatched': true, -'menu': {"side":"left","useTextContentForMissingTitles":true,"markers":false,"loadIcons":false,"custom":[{"title":"Tools","icon":"","content":""}],"openButton":true}, +'jumpToSlide': true, +'menu': {"side":"left","useTextContentForMissingTitles":true,"markers":false,"loadIcons":false,"custom":[{"title":"Tools","icon":"","content":""}],"openButton":true}, 'smaller': false, // Display controls in the bottom right corner @@ -628,7 +430,7 @@

Learning objectives (LOs)

margin: 0.1, math: { - mathjax: 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js', + mathjax: 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.9/MathJax.js', config: 'TeX-AMS_HTML-full', tex2jax: { inlineMath: [['\\(','\\)']], @@ -771,8 +573,6 @@

Learning objectives (LOs)

}); clipboard.on('success', onCopySuccess); if (window.document.getElementById('quarto-embedded-source-code-modal')) { - // For code content inside modals, clipBoardJS needs to be initialized with a container option - // TODO: Check when it could be a function (https://github.com/zenorocha/clipboard.js/issues/860) const clipboardModal = new window.ClipboardJS('.code-copy-button[data-in-quarto-modal]', { text: getTextToCopy, container: window.document.getElementById('quarto-embedded-source-code-modal') diff --git a/slides/00-intro.html b/slides/00-intro.html index a96e0ba..1a42cf6 100644 --- a/slides/00-intro.html +++ b/slides/00-intro.html @@ -6,9 +6,8 @@ - - - + + Rust Programming Language Book Club – Introduction @@ -29,209 +28,11 @@ vertical-align: middle; } - + - - + - - + - - + - - + - - + - - + - - + - - + - - + - - + - - + - - + - - + - - + - +
+

Example

+
/// Adds one to the input number.
+///
+/// # Examples
+///
+/// ```
+/// let result = my_crate::add_one(1);
+/// assert_eq!(result, 2);
+/// ```
+pub fn add_one(x: i32) -> i32 {
+    x + 1
+}
+ +
+
+
+

Organizing Large Projects with Workspaces

+
+
+

What is a Workspace?

+
    +
  • A workspace groups multiple crates.
  • +
  • Shared: +
      +
    • Cargo.lock (dependency versions).
    • +
    • target directory (build artifacts).
    • +
  • +
+
+
+

Workspace Configuration

+
[workspace]
+members = ["crate1", "crate2"]
+

Benefits: - Simplifies management of interdependent crates. - Avoids redundant compilation of dependencies.

+
-
-

SLIDE SECTION

+
+

Using Workspaces

-
-

SLIDE

+
+

Examples Structure

+
my_project/
+├── Cargo.toml (workspace root)
+├── crate1/
+│   ├── Cargo.toml
+│   └── src/
+├── crate2/
+│   ├── Cargo.toml
+│   └── src/
+└── target/
+
+
+

Building and Testing

    -
  • DENOTE MAJOR SECTIONS WITH # TITLE (eg # Installation)
  • -
  • ADD INDIVIDUAL SLIDES WITH ## (eg ## rustup on Linux/macOS)
  • -
  • KEEP THEM RELATIVELY SLIDE-LIKE; THESE ARE NOTES, NOT THE BOOK ITSELF.
  • +
  • Build entire workspace: cargo build.
  • +
  • Test specific crate: cargo test -p crate1.
+
+
+
+

Installing Binaries with Cargo

+
-
-

SLIDE

+
+

Installing Binary Crates

+
    +
  • Use cargo install:
  • +
+
cargo install ripgrep
+
    +
  • Binaries stored in ~/.cargo/bin (add to $PATH).

  • +
  • Run the tool:

  • +
+
rg --help
-
-

SLIDE SECTION

+
+

Extending Cargo with Custom Commands

-
-

SLIDE

+
+

Custom Commands

+
    +
  • Name binaries as cargo-<command>.
  • +
  • Accessible via cargo <command>.
  • +
-
-

SLIDE

+
+

Example:

+
    +
  • A binary named cargo-fancy:
  • +
+
cargo fancy
+

Benefits: - Extend Cargo without modifying it. - Automatically integrates into cargo --list.

+
+
+

Summary

+
    +
  • Optimize builds using dev and release profiles.
  • +
  • Publish crates to crates.io (with clear documentation!).
  • +
  • Manage multi-crate projects with shared dependencies.
  • +
  • Install and use binaries with cargo install.
  • +
  • Create custom Cargo commands for specialized workflows.
  • +
+ -
+
+ + -
- - + @@ -419,7 +427,8 @@

SLIDE

'autoAnimateEasing': "ease", 'autoAnimateDuration': 1, 'autoAnimateUnmatched': true, -'menu': {"side":"left","useTextContentForMissingTitles":true,"markers":false,"loadIcons":false,"custom":[{"title":"Tools","icon":"","content":""}],"openButton":true}, +'jumpToSlide': true, +'menu': {"side":"left","useTextContentForMissingTitles":true,"markers":false,"loadIcons":false,"custom":[{"title":"Tools","icon":"","content":""}],"openButton":true}, 'smaller': false, // Display controls in the bottom right corner @@ -573,7 +582,7 @@

SLIDE

margin: 0.1, math: { - mathjax: 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js', + mathjax: 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.9/MathJax.js', config: 'TeX-AMS_HTML-full', tex2jax: { inlineMath: [['\\(','\\)']], @@ -716,8 +725,6 @@

SLIDE

}); clipboard.on('success', onCopySuccess); if (window.document.getElementById('quarto-embedded-source-code-modal')) { - // For code content inside modals, clipBoardJS needs to be initialized with a container option - // TODO: Check when it could be a function (https://github.com/zenorocha/clipboard.js/issues/860) const clipboardModal = new window.ClipboardJS('.code-copy-button[data-in-quarto-modal]', { text: getTextToCopy, container: window.document.getElementById('quarto-embedded-source-code-modal') diff --git a/slides/15-smart_pointers.html b/slides/15-smart_pointers.html index e1da859..fc6bf1a 100644 --- a/slides/15-smart_pointers.html +++ b/slides/15-smart_pointers.html @@ -6,9 +6,8 @@ - - - + + Rust Programming Language Book Club – 15. Smart Pointers @@ -29,209 +28,11 @@ vertical-align: middle; } - + - - + - - + - - + - - + - - + - - + -